UTC 转换为夏令时用户时区
好的,我从 http://dev.mysql.com/downloads/timezones 安装了 mySql 时区包。 html
我还用 UTC_TIMESTAMP();
存储我的所有时间
,还有我的一点代码:
$_SESSION['user_tz'] = 'America/New_York';
$last = "CONVERT_TZ(p.posted_on, 'UTC', '{$_SESSION['user_tz']}')";
我得到了 UTC/GMT -5 小时
这是由于夏令时(DST),提前一个小时
我已经检查搜索堆栈溢出和谷歌几个小时了,仍然不太确定如何解决这个问题。我真的很困惑如何解决这个问题?非常感谢您的帮助。
OK I got my mySql timezone package installed from http://dev.mysql.com/downloads/timezones.html
I'm also storing all my times with UTC_TIMESTAMP();
And my little tidbit of code:
$_SESSION['user_tz'] = 'America/New_York';
$last = "CONVERT_TZ(p.posted_on, 'UTC', '{$_SESSION['user_tz']}')";
I get back UTC/GMT -5 hours
which is an hour ahead because of daylight savings time (DST)
I've been checking searching stack overflow and google for a few hours now, still not quite sure how to work around this. I'm really confused as to how to work around this? Help is greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编写
参考
write
Reference