ZF-10776: Zend_XmlRpc_Value_DateTime uses wrong ISO format string
Description
The Zend_XmlRpc_Value_DateTime->_isoFormatString is set to 'YYYYMMddTHH:mm:ss', which is results in the wrong year being encoded when the date is at the beginning of the year.
Reproduce code: $date = new Zend_Date('2010-01-01 00:00:00', Zend_Date::ISO_8601); $xmlRpcDate = new Zend_XmlRpc_Value_DateTime($date); var_dump($xmlRpcDate->getValue());
Output: string(17) "20090101T00:00:00"
Comments
Posted by Mason Malone (masonm) on 2010-12-03T14:36:50.000+0000
Here's a patch:
Index: XmlRpc/Value/DateTime.php
--- XmlRpc/Value/DateTime.php (revision 23198) +++ XmlRpc/Value/DateTime.php (working copy) @@ -48,7 +48,7 @@ * * @var string */ - protected $_isoFormatString = 'YYYYMMddTHH:mm:ss'; + protected $_isoFormatString = 'yyyyMMddTHH:mm:ss';
Posted by Ramon Henrique Ornelas (ramon) on 2010-12-18T05:23:21.000+0000
Fixed in trunk r23550 merged to release branch 1.11 r23552 - thanks.