ZF-11992: Wrong date in Zend_Date
I have the code: $days = 12 $today = new Zend_Date(date('Y-m-d'), 'YYYY-MM-dd'); $minusTwoWeeks = $today->subDay($days); echo date('Y-m-d', $minusTwoWeeks->toValue());
Today is 2012-01-12 So I receive 2011-12-31 And it is correct. If I change $days to 10, I receive 2012-01-02 and it is also correct. But if I change $days to 11 I receive 2011-01-02. The year is incorrect! I tried several times, the result was the same. Then I waited 15 minutes, after that everything became good. 2012-01-01. But why it has changed?