【问题标题】:PHP Function StrtotimePHP 函数 Strtotime
【发布时间】:2010-11-25 11:22:39
【问题描述】:

我将“Y-m-d H:i”格式的日期传递给 strtotime,结果返回的时间减少了 5 小时 30 分钟。

【问题讨论】:

  • PHP 时区设置是否正确?您可能可以使用 phpinfo() 函数看到它。
  • 鉴于您可能来自亚洲(例如印度,IIRC 是 GMT +5:30),这可能是时区问题。请提供更多详细信息

标签: php strtotime


【解决方案1】:

确保您正确设置了时区。您可以使用date_default_timezone_set() 将其设置为您想要的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-17
    • 2011-06-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多