Zend日期DST错误:测试日期是否为“时间变化”日期 [英] Zend Date DST Bug: Test whether a date is a "time change" date

查看:109
本文介绍了Zend日期DST错误:测试日期是否为“时间变化”日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现 Zend Date的DST Bug的解决方法,但是解决方法引入了另一个错误。解决方法只需设置两次。这引入了另一个错误,如果生成的日期越过日期边界,则该日期递增或递减。

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.

我想知道是否有办法确定日期手是一个时间变化日期,所以我可以想出一个坚实的解决方法到 Zend日期DST错误

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.

推荐答案

事实证明PHP的功能 localtime()返回日期是否在DST中。我已经使用该信息更新我的子类版本的 Zend_Date :: setTime()。我已经更新了我的 Zend日期DST Bug 的信息,以包含此在解决方案中。

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.

这篇关于Zend日期DST错误:测试日期是否为“时间变化”日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆