开发者

Php-how to change timezone with daylight savings?

hey ! I'm working on a php web app , a开发者_JAVA技巧nd i'm trying to change the time zone for each user according to his location , i was using this SQL statement : SET time_zone every time i'm about to display date and time , but when it comes to day light savings time , it does not work at all (ex : before daylight savings , timezone offset for Us&Canada Mountain time is -7 hours but now it's -8 hours and the code i'm using does not help at all ) ;

Thank you for you help


http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html,

The value can be given as a named time zone, such as 'Europe/Helsinki', 'US/Eastern', or 'MET'. Named time zones can be used only if the time zone information tables in the mysql database have been created and populated.

Seems to me that means you can use entries from the tz database such as America/Denver.

Note: Mountian is currently -6, not -8.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜