ZF-10776: Zend_XmlRpc_Value_DateTime uses wrong ISO format string

Issue Type: Bug Created: 2010-12-03T14:33:17.000+0000 Last Updated: 2010-12-18T05:23:21.000+0000 Status: Resolved Fix version(s): - 1.11.2 (30/Dec/10)

Reporter: Mason Malone (masonm) Assignee: Ramon Henrique Ornelas (ramon) Tags: - Zend_XmlRpc_Client

Related issues: - ZF-5297



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"


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

  * Set the value of a dateTime.iso8601 native type

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.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.