ZF-11278: Problem with Zend_Date and a valid ISO_8601 - Timestamp given in the construct

Issue Type: Bug Created: 2011-04-11T13:58:54.000+0000 Last Updated: 2012-01-13T10:52:04.000+0000 Status: Open Fix version(s): Reporter: Erdbeer Gulasch (erdbeergulasch) Assignee: Thomas Weidner (thomas) Tags: - Zend_Date

Related issues: Attachments:


If you give a valid Timestamp, which looks like that: 2010-02-02T20:10:00+01 instead of that 2010-02-02T20:10:00+05:00 you get the wrong Timestamp back grom the Zend_Date - Construct.

See example below:

CODE: $date1 = new Zend_Date( '2010-02-02T20:10:00', Zend_Date::ISO_8601 ); $date2 = new Zend_Date( '2010-02-02T20:10:00+05', Zend_Date::ISO_8601 ); $date3 = new Zend_Date( '2010-02-02T20:10:00+05:00', Zend_Date::ISO_8601 ); echo $date1->getIso() . "\n"; echo $date2->getIso() . "\n"; echo $date3->getIso() . "\n";

OUTPUT: 2010-02-02T20:10:00+01:00 2010-02-02T20:10:00+01:00 2010-02-02T20:10:00+05:00

Expected Output: 2010-02-02T20:10:00+01:00 2010-02-02T20:10:00+05:00 2010-02-02T20:10:00+05:00


Posted by Thomas Weidner (thomas) on 2011-04-16T21:49:29.000+0000

+05 is no valid timezone. Therefor this characters are ignored and the servers timezone is used.

Posted by Erdbeer Gulasch (erdbeergulasch) on 2011-04-18T09:21:16.000+0000

But if you look at…, then you see, that the timestamp 2010-02-02T20:10:00+05 is also a valid ISO8601-Timestamp.


If you wonder, why i am getting this format, you can install postgresql, and you see this timestamp as output of a sql-select.…

Posted by Andrey Shevchenko (distdev) on 2011-04-28T12:36:31.000+0000

According to ISO +05, +05:00 and +0500 are valid timezones. See, page 18

Posted by Thomas Weidner (thomas) on 2011-07-30T21:17:12.000+0000

Please note that ISO 8160 is about textiles. Zend_Date will never take care about the production process of textured filament yarns which is described by this ISO norm.

Posted by Erdbeer Gulasch (erdbeergulasch) on 2012-01-13T10:45:58.000+0000

You have to look at ISO8601 not ISO8160. If you open the posted links, you would see what you need.

Posted by Erdbeer Gulasch (erdbeergulasch) on 2012-01-13T10:52:04.000+0000

Sorry for the wrong title of the Issue, i have fixed the title now.

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.