Issues

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

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';

 /**
  * Set the value of a dateTime.iso8601 native type

Fixed in trunk r23550 merged to release branch 1.11 r23552 - thanks.