开发者

PHP date function not working as expected

开发者 https://www.devze.com 2023-03-18 17:06 出处:网络
I am using this echo(开发者_运维知识库date(\"Y\",\'2009-10-01\')); to extract the year but it only gives me the incorrect year 1970 or 1969!

I am using this echo(开发者_运维知识库date("Y",'2009-10-01')); to extract the year but it only gives me the incorrect year 1970 or 1969!

What am i doing wrong.

Thanks


change to

echo(date("Y",strtotime('2009-10-01'))); 

and try again

0

精彩评论

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

关注公众号