我尝试插入rss pubdate到我的MySQL数据库。日期格式为:插入rss pubdate到MySQL数据库
Tue, 16 apr 2013 17:04:08 UT
我尝试使用不同的函数来格式化这个pubdate,但是我在日期UT时区有问题。我试过的功能:
strftime("%a, %d %b %G %H %M %S", strtotime($pubdate));
date_create_from_format('D, d M Y G:i:s U', $pubdate);
有人能帮帮我吗?
什么错误(S),你接收?你试图插入pubdate的列的数据类型是什么? –
我的日期保存在mysql下的0000-00-00 00:00:00 – user1809753
当我执行下面的函数时我得到警告:date_format()期望参数1是DateTime。 $ date date_create_from_format('D,d M Y G:i:s','Tue,2013年4月16日17:04:08 UT'); – user1809753