Zend Framework

Errors in Zend_Date document

Details

  • Type: Docs:  Problem Docs: Problem
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.6.0
  • Component/s: Zend_Date
  • Labels:
    None
  • Language:
    English

Description

I found two problems in Zend_Date document.
http://framework.zend.com/manual/en/zend.date.additional.html#zend.date.additional.timezones.example-2

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();

Activity

Hide
Thomas Weidner added a comment -

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

Show
Thomas Weidner added a comment - The second is not a fault, it's expected and works. The real ISO standard defines also this sort of input as correct.
Hide
Thomas Weidner added a comment -

Typo fixed with r9396

Show
Thomas Weidner added a comment - Typo fixed with r9396
Hide
TAKAGI Masahiro added a comment -

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/zend.date.additional.html#zend.date.additional.timezones.example-2

Show
TAKAGI Masahiro added a comment - 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/zend.date.additional.html#zend.date.additional.timezones.example-2
Hide
Thomas Weidner added a comment -

Typo fixed in r9447

Show
Thomas Weidner added a comment - Typo fixed in r9447
Hide
Wil Sinclair added a comment -

Changing to comply with new IT coventions for components.

Show
Wil Sinclair added a comment - Changing to comply with new IT coventions for components.
Hide
Wil Sinclair added a comment -

Updating for the 1.6.0 release.

Show
Wil Sinclair added a comment - Updating for the 1.6.0 release.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
Not Specified
Original Estimate - Not Specified
Remaining:
0m
Remaining Estimate - 0 minutes
Logged:
10m
Time Spent - 10 minutes