首页 > 其他 > 详细

strtotime 的 BUG

时间:2019-11-16 11:52:16      阅读:81      评论:0      收藏:0      [点我收藏+]

strtotime(‘+1 month‘),strtotime(‘-1 month‘)  碰到一个月中有28, 31天的就会有问题, 比如 strtotime(‘+1 month‘, strtotime(‘2019-10-31‘)) 就会跳到 12月份去,而不是11月份;

所以一般要用 

strtotime(‘last day of +1month‘)

 

或者

strtotime(‘first day of +1 month‘)

 

strtotime 的 BUG

原文:https://www.cnblogs.com/pyspang/p/11871012.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!