Bug #51975 [NEW]: Missing DST free (UTC±X) timezones in DateTimeZone::listIdentifiers()
| From: | V-o-E at gmx dot de | Date: | Wed, 02 Jun 2010 13:27:50 +0000 |
| Subject: | Bug #51975 [NEW]: Missing DST free (UTC±X) timezones in DateTimeZone::listIdentifiers() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-151018@lists.php.net to get a copy of this message | ||
From:
Operating system: All
PHP version: 5.3.2
Package: Date/time related
Bug Type: Bug
Bug description:Missing DST free (UTC±X) timezones in DateTimeZone::listIdentifiers()
Description:
------------
There are not daylight saving time free timezones (UTC±X) in
DateTimeZone::listIdentifiers() (same with DateTimeZone::ALL) except
UTC±0.
As workaround i can use buggy "Etc/GMT±X" from
DateTimeZone::listIdentifiers(DateTimeZone::ALL_WITH_BC):
Etc/GMT+2 => Etc/GMT-2
Etc/GMT-2 => Etc/GMT+2
See: http://en.wikipedia.org/wiki/List_of_time_zones_by_UTC_offset
Test script:
---------------
var_dump(DateTimeZone::listIdentifiers(DateTimeZone::ALL_WITH_BC));
var_dump(DateTimeZone::listIdentifiers());
$a = DateTimeZone::listIdentifiers(DateTimeZone::ALL_WITH_BC);
var_dump($a[373]); // output: string(9) "Etc/GMT+2"
$b = DateTimeZone::listIdentifiers();
var_dump($b[373]); // output: string(15) "Pacific/Fakaofo"
date_default_timezone_set('UTC');
echo date('H:i:s') . "\n"; // output: 13:13:01
date_default_timezone_set('Etc/GMT+2');
echo date('H:i:s') . "\n"; // output: 11:13:01
date_default_timezone_set('Etc/GMT-2');
echo date('H:i:s') . "\n"; // output: 15:13:01
date_default_timezone_set('Pacific/Fakaofo');
echo date('H:i:s') . "\n"; // output: 01:13:01
Expected result:
----------------
array(564) {
...
}
array(xyz) {
...
[405]=>
string(3) "UTC"
[406]=>
string(3) "UTC-12"
[407]=>
string(3) "UTC-11"
...
}
string(9) "Pacific/Fakaofo"
string(15) "Pacific/Fakaofo"
13:16:08
15:16:08
11:16:08
03:16:08
Actual result:
--------------
array(564) {
...
}
array(406) {
...
[405]=>
string(3) "UTC"
}
string(9) "Etc/GMT+2"
string(15) "Pacific/Fakaofo"
13:16:08
11:16:08
15:16:08
03:16:08
--
Edit bug report at http://bugs.php.net/bug.php?id=51975&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51975&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51975&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=51975&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=51975&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51975&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51975&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51975&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51975&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51975&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51975&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51975&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51975&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51975&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51975&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51975&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51975&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51975&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51975&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51975&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51975&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51975&r=mysqlcfg