ZF-3198: Errors in Zend_Date document
Description
I found two problems in Zend_Date document. http://framework.zend.com/manual/en/…
typo 'date_defaut_timezone_set' should be 'date_default_timezone_set'.
ISO-8601 uncompliant data '10.03.2007 00:00:00' should be '2007-10-03 00:00:00'.
Here is a patch for Zend_Date-Additional.xml
Index: trunk/documentation/manual/en/module_specs/Zend_Date-Additional.xml
--- trunk/documentation/manual/en/module_specs/Zend_Date-Additional.xml (revision 9385) +++ trunk/documentation/manual/en/module_specs/Zend_Date-Additional.xml (working copy) @@ -295,10 +295,10 @@
// Set a default timezone... this has to be done within the bootstrap file or php.ini // We do this here just for having a complete example -date_defaut_timezone_set('Europe/Vienna'); +date_default_timezone_set('Europe/Vienna');
// create a date object -$date = new Zend_Date('10.03.2007 00:00:00', Zend_Date::ISO_8601, 'de'); +$date = new Zend_Date('2007-10-03 00:00:00', Zend_Date::ISO_8601, 'de');
// view our date object print $date->getIso();
Comments
Posted by Thomas Weidner (thomas) on 2008-05-07T05:55:35.000+0000
The second is not a fault, it's expected and works. The real ISO standard defines also this sort of input as correct.
Posted by Thomas Weidner (thomas) on 2008-05-07T07:12:43.000+0000
Typo fixed with r9396
Posted by TAKAGI Masahiro (takagi) on 2008-05-07T15:09:00.000+0000
When I try Example 9.22 (*1), I expect the output is
2007-10-03T00:00:00+02:00 2007-10-03T00:00:00+02:00 2007-10-02T17:00:00-05:00 2007-10-02T17:00:00-05:00
But the actual result is
1970-01-01T00:00:00+01:00 1970-01-01T00:00:00+01:00 1969-12-31T18:00:00-05:00 1969-12-31T17:00:00-06:00
Is it the docu's bug or Zend_Date's?
(*1) http://framework.zend.com/manual/en/…
Posted by Thomas Weidner (thomas) on 2008-05-12T13:18:11.000+0000
Typo fixed in r9447
Posted by Wil Sinclair (wil) on 2008-06-15T20:44:08.000+0000
Changing to comply with new IT coventions for components.
Posted by Wil Sinclair (wil) on 2008-09-02T10:39:15.000+0000
Updating for the 1.6.0 release.