【发布时间】:2017-03-16 06:35:17
【问题描述】:
即使我将时区设置为UTC-9,我也会得到下周的日期。
当UTC更改日期即16-03-2017 00:00:00,而UTC-9时区仍为15-03-2017 15:00:00时,strtotime()函数返回下周的日期。
$last_time_instance = strtotime(''Wednesday' ' 16:00:00);
变量$last_time_instance 正确返回时间,但将日期转发到下一周,即22-03-17。
我该如何解决这个问题?
【问题讨论】:
-
在程序中使用 date_default_timezone_set()。
-
我应该在 strtotime() 函数中使用吗?
-
在您的程序顶部,或就在
strtotime()之前
标签: php date datetime utc strtotime