ZF-7858: ISO_8601 format wrong

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

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

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

PHP 5.2.9 timezone: europe/berlin locale: de

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

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

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.