【发布时间】:2011-05-05 23:56:28
【问题描述】:
全部,
如何将 unix 时间戳转换为本地时区的日期和时间。对于时间戳 = 1303374724716,PHP 的date ('r', $timestamp) 函数为我提供Sun, 16 May 2032 22:11:37 +0000 而epoch converter 正确转换为GMT: Thu, 21 Apr 2011 08:32:04 GMT
Your timezone: Thu Apr 21 2011 04:32:04 GMT-0400 (Eastern Daylight Time)
我看过 php.ini 文件,默认时区是 UTC。我不明白为什么该值甚至与 GMT/UTC 时间不匹配。谁能帮我转换为我的本地时区,即 New_York。
【问题讨论】:
标签: php unix-timestamp