ZF-10253: Zend_Date improperly interprets ISO_8601 dates

Issue Type: Bug Created: 2010-07-30T13:21:28.000+0000 Last Updated: 2012-11-20T21:38:08.000+0000 Status: Open Fix version(s): Reporter: Brandon Savage (brandonsavage) Assignee: None Tags: - Zend_Date

Related issues: Attachments:


Description: When passing ISO_8601-compliant dates, complete with timezone, one expects Zend_Date to properly accept and parse that date. However, it does not.

Note the actual result below, Zend_Date ignores the timezone on the date and instead assumes the local timezone (which for me was America/New_York) while DateTime does not.


format('c') . ' '; echo 'Zend\_Date: ' . $dt2->get(Zend\_Date::ISO\_8601); ?> Expected Result: Time: 2010-07-29 17:11:52.241004+00 DateTime: 2010-07-29T17:11:52+00:00 Zend\_Date: 2010-07-29T17:11:52+00:00

Actual Result:

Time: 2010-07-29 17:11:52.241004+00 DateTime: 2010-07-29T17:11:52+00:00 Zend_Date: 2010-07-29T17:11:52-04:00


Posted by Thomas Weidner (thomas) on 2010-07-30T14:01:25.000+0000

Actually wether the millisecond part nor the truncated timezone are proper ISO_8601 inputs.

Posted by Brandon Savage (brandonsavage) on 2010-08-03T06:39:48.000+0000

According to the Wikipedia article on ISO 8601, the truncated UTC offset is valid. (See… for more)

The fractional time is not ISO 8601; however, the removal of this does not affect the bug.

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.