PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Date and Time » Date » Bug #1640

Date_TimeZone doesn't recognize 'EDT'

Details

Submitted2004-06-15 02:54 UTC
Fromphp040604 at awks dot org
Assigneddanielc
StatusClosed
PackageDate
PHP VersionIrrelevant
OSLinux
Roadmaps(Not assigned)

Comments

[2004-06-15 02:54 UTC] php040604 at awks dot org

Description:
------------
Date_TimeZone uses UTC instead of EST when the timezone
name is "EDT". The fix is to create an entry for EDT
alongside EST and EST5EDT in the code.

By the way, have you considered making each timezone entry
a separate file, such as a short .ini file, and just have
Date_TimeZone load that one file whenever a timezone is
loaded? For instance, if "America/Thunder_Bay" is the
timezone, it would load data from:
"Date/timezone-data/America/Thunder_Bay.ini" and so forth.

That way the code wouldn't have to parse and carry around
the full array of timezones.

Reproduce code:
---------------
require_once 'Date/TimeZone.php';

$dtz = Date_TimeZone::getDefault();

$php_tz = date('T'); // on my machine this returns 'EDT'
$pear_tz = $dtz->getShortName();

print("$php_tz =? $pear_tz\n");

Expected result:
----------------
EDT =? EST

Actual result:
--------------
EDT =? UTC

[2004-06-15 17:04 UTC] pierre at dotgeek dot org

Which version of Date (package version)?

--Pierre

[2004-06-16 08:03 UTC] php040604 at awks dot org

version is 1.4.3