Bug #70502 [Com]: Kathmandu time zone offset is wrong
| From: | phil dot davis at inf dot org | Date: | Tue, 15 Sep 2015 12:39:20 +0000 |
| Subject: | Bug #70502 [Com]: Kathmandu time zone offset is wrong | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-196010@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70502&edit=1
ID: 70502
Comment by: phil dot davis at inf dot org
Reported by: phil dot davis at inf dot org
Summary: Kathmandu time zone offset is wrong
Status: Open
Type: Bug
Package: Date/time related
Operating System: Multiple
PHP Version: 5.5.29
Block user comment: N
Private report: N
New Comment:
Looking in https://github.com/php/php-src/blob/master/ext/date/lib/timezonemap.h
Search for "npt".
Unfortunately lots of places seem to like to use the time zone abbreviation "npt". The
first of these is "America/St_Johns". That is a bit unfortunate, but part of life, I guess
:)
So the only real problem I see here is with Asia/Kathmandu and Asia/Katmandu being listed in the
Indian Stndard Time zone "ist".
The proposed fix for that is the referenced pull request 1522 mentioned here.
Previous Comments:
------------------------------------------------------------------------
[2015-09-15 11:58:40] phil dot davis at inf dot org
Description:
------------
NPT is supposed to be the abbreviation for Nepal Time (Asia/Kathmandu)
http://www.timeanddate.com/time/zones/
but timezone_name_from_abbr("NPT") returns:
string(16) "America/St_Johns"
DateTimeZone::listAbbreviations() shows Asia/Kathmandu with offset 19800.
19800 = 3600 * 5.5 which is UTC+05:30 - that is the time zone for Indian cities like Kokata.
Nepal Kathmandu is UTC+05:45 so the offset should be 3600 * 5.75 = 20700
Test script:
---------------
$x = timezone_name_from_abbr("NPT");
var_dump($x);
$y = DateTimeZone::listAbbreviations();
var_dump($y);
Expected result:
----------------
$x should have "Asia/Kathmandu"
The output in $y should have for Asia/Kathmandu and Asia/Katmandu
[7]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(20700)
["timezone_id"]=>
string(14) "Asia/Kathmandu"
}
[8]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(20700)
["timezone_id"]=>
string(13) "Asia/Katmandu"
}
Actual result:
--------------
string(16) "America/St_Johns"
In the $y output:
[7]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(19800)
["timezone_id"]=>
string(14) "Asia/Kathmandu"
}
[8]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(19800)
["timezone_id"]=>
string(13) "Asia/Katmandu"
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70502&edit=1