php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48530 Timezone GMT+08:00 Beijing,Chongqing,... not recognized by date("c")
Submitted: 2009-06-11 12:36 UTC Modified: 2009-06-12 08:02 UTC
From: lieven_vaneeckhaute at symantec dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.9 OS: Windows XP
Private report: No CVE-ID: None
 [2009-06-11 12:36 UTC] lieven_vaneeckhaute at symantec dot com
Description:
------------
On Windows I'm running in timezone Beijing,... which is +08:00.
If echo date("c") or date("r") it displays as Thu, 11 Jun 2009 12:27:54 +0000 rather than 20:27:54 +0800.

To us for reporting reasons it is very useful to know what time it was on the local system. We run php as CLI.


Reproduce code:
---------------
<?php
echo date("r");
?>


Expected result:
----------------
Display 20:27:54 +0800 rather than 12:27:54 +0000.

Actual result:
--------------
Thu, 11 Jun 2009 12:27:54 +0000

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-11 22:58 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

YOu need to set the date.timezone setting: http://nl3.php.net/manual/en/datetime.configuration.php#ini.date.timezone
 [2009-06-12 08:02 UTC] lieven_vaneeckhaute at symantec dot com
Most other time zones (all of them on Linux) are recognized but Beijing isn't on a Windows.
This makes our customers in this time zone unhappy.
PHP runs on their machines. We want to have the local time, not GMT or some other incorrect timezone.

Setting a default time zone that is recognized(not Beijing) doesn't really solve our problem.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 02 04:01:29 2024 UTC