Look into the FAQ and the manual what the difference between "Y" and "y" is.

Best regards,
Thomas Weidner

Zend Framework Certified Engineer & I18N Team Leader
http://www.thomasweidner.com

-----Ursprüngliche Nachricht-----
Von: debussy007 [mailto:debussy...@gmail.com] 
Gesendet: Samstag, 18. September 2010 12:17
An: fw-general@lists.zend.com
Betreff: [fw-general] Zend date add/sub methods don't change year ?


Hello,

When I add a second to '2010-12-31 23:59:59', I get '2010-01-01 00:00:00'.
Instead of 2011 I have 2010

Test code :

$t = '2010-12-31 23:59:59';
$zd = new Zend_Date($t, 'YYYY-MM-dd HH:mm:ss'); echo $zd->get('YYYY-MM-dd
HH:mm:ss'); echo '<br>'; $zd->addSecond(1); echo $zd->get('YYYY-MM-dd
HH:mm:ss'); echo '<br>';

Prints :

2010-12-31 23:59:59
2010-01-01 00:00:00
--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/Zend-date-add-sub-metho
ds-don-t-change-year-tp2544881p2544881.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to