php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #67242 No Timezone specified for Pakistan
Submitted: 2014-05-10 02:56 UTC Modified: 2014-08-16 10:46 UTC
From: farhan at askwhyweb dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.4.28 OS: ANY
Private report: No CVE-ID: None
 [2014-05-10 02:56 UTC] farhan at askwhyweb dot com
Description:
------------
---
From manual page: http://www.php.net/timezones
---
There is no such timezone for Pakistan (an asian country).

When use Asia/Pakistan the PHP throws error saying not applicable.

Quite strange but it needs to be there.

Test script:
---------------
date_default_timezone_set('Etc/GMT+5');
echo "The time is " . date("h:i:sa");
// Output is 14 hours above the original time.

// Second case
date_default_timezone_set('Asia/Pakistan');
echo "The time is " . date("h:i:sa");
// Output no error but time behind 3 hours to the original time.

Expected result:
----------------
Was expecting input for 'Asia/Pakistan' in date_default_timezone_set function which is accepting the region but not giving expected current time of the region.

Actual result:
--------------
Not accurate/ false

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-08-16 00:10 UTC] ppasindud at gmail dot com
Asia/Karachi
 [2014-08-16 10:46 UTC] fa@php.net
-Status: Open +Status: Not a bug
 [2014-08-16 10:46 UTC] fa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Asia/Karachi is correct, c.f. http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
 [2014-12-19 01:55 UTC] bestacademyonline at gmail dot com
Instead of Asia/Pakistan, Use Asia/Karachi.
set_default_timezone_set('Asia/Karachi');
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 08:01:29 2024 UTC