Issues

ZF-3198: Errors in Zend_Date document

Description

I found two problems in Zend_Date document. http://framework.zend.com/manual/en/…

  1. typo 'date_defaut_timezone_set' should be 'date_default_timezone_set'.

  2. 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

The second is not a fault, it's expected and works. The real ISO standard defines also this sort of input as correct.

Typo fixed with r9396

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/…

Typo fixed in r9447

Changing to comply with new IT coventions for components.

Updating for the 1.6.0 release.