开发者

php date misinterpretation

I run this:

echo date('开发者_JAVA技巧l, F jS Y','2011-02-12 14:44:00');

I get this:

Wednesday, December 31st 1969

What's wrong?


The second argument for date needs to be a UNIX timestamp, not a date string. Use:

echo date('l, F jS Y', strtotime('2011-02-12 14:44:00'));

http://php.net/manual/en/function.date.php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜