php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50520 fallbackmap.h missing entry for GMT-8 without daylight saving time
Submitted: 2009-12-18 16:39 UTC Modified: 2009-12-18 17:50 UTC
From: chikei at gmail dot com Assigned:
Status: Wont fix Package: Date/time related
PHP Version: 5.3SVN-2009-12-18 (snap) OS: FreeBSD 7.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: chikei at gmail dot com
New email:
PHP Version: OS:

 

 [2009-12-18 16:39 UTC] chikei at gmail dot com
Description:
------------
In ext/date/lib/fallbackmap.h you have:
        { "krat",  0,    7,  "Asia/Krasnoyarsk" },
        { "krast", 1,    8,  "Asia/Krasnoyarsk" },
        { "jst",   0,    9,  "Asia/Tokyo" },

but lots east Asia region do not use daylight saving time.
And in the test server if I use /usr/share/zoneinfo/Etc/GMT-8 as /etc/localtime, I'll get tm_isdat == 0 after a simple localtime_r call, which then resulting PHP think the timezone is UTC. (I removed date.timezone entry in php.ini since i want PHP using OS's timezone setting.)

Reproduce code:
---------------
Remove date.timezone entry in php.ini and use /usr/share/zoneinfo/Etc/GMT-8 as /etc/localtime, then run date_default_timezone_get()

Expected result:
----------------
Should return some timezone rest in GMT-8 region. (such as HongKong or Asia/Vientiane)

Actual result:
--------------
Returns UTC

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-18 17:50 UTC] derick@php.net
This fallback map is there for backwards compatible reasons *only*. From PHP 5.1 onwards you are supposed to make this "date.timezone" setting in php.ini. Relying on the system timezone is *not* going to work properly. Therefore, I am not adding a mapping for UTC+8.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 06 06:01:27 2024 UTC