×
新动弹计划
2021-08-10 12:58
#daily tips# 我曾经以为strtotime是php一个杀手级的函数,直到最近才发现被它坑了一把,它处理不了小数点的时间间隔,比如 strtotime( '2021-01-01 01:00 + 2.5hours') 你以为它会输出3点30分的timestamp吗?不是,它会先把时区设成GMT+2,然后再把时间设置成+5小时,什么鬼?!!参考:https://stackoverflow.com/questions/22804223/php-strtotime-2-5-hours-bug
0

暂无评论