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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC