开发者

strtotime bug with recognizing last month

开发者 https://www.devze.com 2023-04-10 21:49 出处:网络
echo strtotime(\"first day of last month\"); returns 1317492376but it\'s 6开发者_运维技巧 pm of 1 september! Shouldn\'t it return the timestamp of first second of the month? If not, how to get it?st
echo strtotime("first day of last month");

returns 1317492376but it's 6开发者_运维技巧 pm of 1 september! Shouldn't it return the timestamp of first second of the month? If not, how to get it?


strtotime() doesn't touch the time part when you specify only the date. Try this:

strtotime( "first day of last month 00:00" ) 
0

精彩评论

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

关注公众号