Bug #70502 [NEW]: Kathmandu time zone offset is wrong

From: Date: Tue, 15 Sep 2015 11:58:42 +0000
Subject: Bug #70502 [NEW]: Kathmandu time zone offset is wrong
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196008@lists.php.net to get a copy of this message
From:             phil dot davis at inf dot org
Operating system: Multiple
PHP version:      5.5.29
Package:          Date/time related
Bug Type:         Bug
Bug description:Kathmandu time zone offset is wrong

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 bug report at https://bugs.php.net/bug.php?id=70502&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=70502&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=70502&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=70502&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=70502&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=70502&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=70502&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=70502&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=70502&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=70502&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=70502&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=70502&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=70502&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=70502&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70502&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=70502&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=70502&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=70502&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70502&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=70502&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=70502&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#196008) next »