Daylight saving issues
Possible Duplicate:
Daylight saving time and Timezone best practices
Basically I have the following problem:
I have a table with all the GMT offsets and based on that I calculated the users hour relative to the servers hour but some are off by an hour.
So my function looks like this, it takes GMT+/-3600*usersTZ(GMT offset). London looks ok, Australia looks ok, but hey Samoa, instead of being eg: 5 it`s 6.
I figured that might be the case with daylight saving, any ideeas?
PHP can handle timezones natively. You just need to set timezone in olson format like America/New_York.
You can then use date_default_timezone_set or any other php DateTime stuff that understands timezones.
It would be very helpful to peruse the PHP docs a little. Especially here and here.
链接地址: http://www.djcxy.com/p/29336.html上一篇: 为不同时区的用户在数据库中存储时间
下一篇: 夏令时问题