【发布时间】:2014-11-29 13:28:28
【问题描述】:
我试图从像这样的日期获得毫秒2014-09-15T10:27:29Z
我尝试了以下
return strtotime('2014-09-15T10:27:29Z');
但它返回一个警告:
It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EST/-5.0/no DST'
所以,我必须使用函数date_default_timezone_set但不固定为'America/New_York':
$userZone = //I don't know what to put here
date_default_timezone_set($userZone);
return strtotime('2014-09-15T10:27:29Z');
如何获取用户时区?
【问题讨论】:
-
你想如何得到不存在的东西?