PHP Timezones getTransitions trustworthy?

邮差的信 提交于 2019-12-10 10:57:24

问题


Have you ever had any issue with PHP timezones conversions through the getTransitions function?

I am trying to convert an Argentinian date into GMT. If I look into the array of transitions, I get:

....
[63] => Array ( [ts] => 1287284400 [time] => 2010-10-17T03:00:00+0000 [offset] => -7200 [isdst] => 1 [abbr] => ARST )
[64] => Array ( [ts] => 1300586400 [time] => 2011-03-20T02:00:00+0000 [offset] => -10800 [isdst] => [abbr] => ART )
...

what means, If I am not wrong, from 2010-10-17 until 2011-03-20 the difference in seconds of the Argentinian date, compared with the GMT equivalent, it will be -7.200 (2 hours).

But reality is the current offset is four hours.

Please, what I am missing? Sorry if looks like homework but I have searched and tried a lot of things before writing the question.

Thanks.

Edit: Thank you for the responses. I understand PHP transitions are hardcoded in PHP dll.s installations, so if any country government decide to change their time policies then getTransitions became obsolete unless you upgrade your PHP installation (something not so easy when you have a production environment or are using a shared hosting).

So new question, there exists any webservices or dynamic API to know the current time delay (or future delay) for a specific timezone, like http://worldtimeengine.com/api/ but perhaps free?


回答1:


I'm not sure that's incorrect?

http://en.wikipedia.org/wiki/Time_in_Argentina

States that generally Argentina is on UTC -3, and that they sometimes observe summer time. Which would make it UTC -2?

On the other hand, the article states that they don't currently observe summer time, so that would keep them at UTC-3 (-10800)? It's possible that the time database you have is old?



来源:https://stackoverflow.com/questions/4037364/php-timezones-gettransitions-trustworthy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!