Issues

ZF-7858: ISO_8601 format wrong

Issue Type: Bug Created: 2009-09-16T04:11:52.000+0000 Last Updated: 2009-09-28T14:08:43.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Marc Frost (bender) Assignee: Thomas Weidner (thomas) Tags: - Zend_Date

Related issues: Attachments:

Description

if year greather 2037 does work Zend_Date::ISO_8601 correct.

$date = new Zend_Date(); $date->setYear(2039); echo $date->get(Zend_Date::ISO_8601);

returns 2039-09-16T12:09:03+0100

correct format is 2039-09-16T12:09:03+01:00

Comments

Posted by Thomas Weidner (thomas) on 2009-09-16T11:37:47.000+0000

So PHP itself is false ? Because dates from 1914 - 2037 are date() based.

Which PHP version are you using ? Which timezone ? Which locale ?

Posted by Marc Frost (bender) on 2009-09-17T08:15:16.000+0000

PHP 5.2.9 timezone: europe/berlin locale: de

Posted by Thomas Weidner (thomas) on 2009-09-28T11:56:00.000+0000

Note that ZF can not fix PHP errors. Unified ZF and PHP's "wrong" behaviour to match.

Posted by Marc Frost (bender) on 2009-09-28T13:27:17.000+0000

PHP work correct, ZF work incorrect.

Zf Formats the locale wrong.

DateObject.php Line 565

            case 'c':  // ISO 8601 date format
                $difference = $this->getGmtOffset();
                $difference = sprintf('%s%04d', ($difference <= 0) ? '+' : '-', abs($difference) / 36);

sprintf 4d is wrong, ISO is hh:mm not hhmm

Posted by Thomas Weidner (thomas) on 2009-09-28T14:08:37.000+0000

You wrote:

{quote} if year greather 2037 does work Zend_Date::ISO_8601 correct. {quote}

And to my question: {quote} So PHP itself is false ? Because dates from 1914 - 2037 are date() based. {quote}

there was no related response from you.

So you believed that PHP produces wrong code.

Note that dates below 2038 are using PHP internal code. And any output produced by PHP itself can not be fixed and should be noted to PHP and not ZF.

Note that the code you gave is not accessed when working with localized dates. ZF has nothing to do with the locale itself. The locale is not formatted, the locale is produced by your browser or system and can not be formatted.

Note additionally the third line of $difference which you omitted, and which adds the ":" char to the output.

Note that issues which are marked as "fixed for the next minor release" are fixed with the next minor release and not the release which you gave.

Have you found an issue?

See the Overview section for more details.

Copyright

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

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

Contacts