Zend Date DST Bug: Test whether a date is a “time change” date

房东的猫 提交于 2020-01-07 02:27:07

问题


I found a workaround for Zend Date's DST Bug, but the workaround introduces another bug. The workaround simply sets the time twice. This introduces another bug, if the resulting date crosses the date boundary, the the day get incremented or decremented.

I am wondering if there's a way to determine that the date at hand is a "time change" date, so that I can come up with a solid workaround to the Zend Date DST bug.


回答1:


It turns out that PHP's function localtime() returns whether or not the date is in DST. I've used that info update my sub-classed version of Zend_Date::setTime(). I've updated my post for Zend Date DST Bug to include this in the solution.



来源:https://stackoverflow.com/questions/8593660/zend-date-dst-bug-test-whether-a-date-is-a-time-change-date

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