|  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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-12-18 16:39 UTC] chikei at gmail dot com
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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-18 17:50 UTC]
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-2022 The PHP Group
All rights reserved.
Last updated: Fri Dec 09 02:05:54 2022 UTC