php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46302 Timezone PHP Don't show the correct time
Submitted: 2008-10-15 14:56 UTC Modified: 2008-10-15 15:04 UTC
From: mfpjr at globo dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.6 OS: RHEL AS 4.7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mfpjr at globo dot com
New email:
PHP Version: OS:

 

 [2008-10-15 14:56 UTC] mfpjr at globo dot com
Description:
------------
Hi,

   the php show incorrect time, i reproduce the error below:

[root@whisper ~]# php -version
PHP 5.2.6 (cli) (built: Oct 15 2008 11:14:30)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
[root@whisper ~]# date
Qua Out 15 11:48:24 BRT 2008
[root@whisper ~]# date -u
Qua Out 15 14:48:27 UTC 2008
[root@whisper ~]# echo $TZ
America/Sao_Paulo
[root@whisper ~]# php -r "print date('d/m/Y H:i:s e T');"
15/10/2008 12:48:41 America/Sao_Paulo BRST

Here is my date info in PHPINFO:

date/time support  enabled  
"Olson" Timezone Database Version  2008.2  
Timezone Database  internal  
Default timezone  America/Sao_Paulo  

Directive Local Value Master Value 
date.default_latitude 31.7667 31.7667 
date.default_longitude 35.2333 35.2333 
date.sunrise_zenith 90.583333 90.583333 
date.sunset_zenith 90.583333 90.583333 
date.timezone America/Sao_Paulo America/Sao_Paulo

   i try to change the date.timzone setting in php.ini but when I test with the command above the Timezone Setting don't change.

Reproduce code:
---------------
php -r "print date('d/m/Y H:i:s e T');"

Expected result:
----------------
Same time from server, the php enable the Daylight Saving Time before OS.

Actual result:
--------------
[root@whisper ~]# php -r "print date('d/m/Y H:i:s e T');"
15/10/2008 12:48:41 America/Sao_Paulo BRST

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-15 15:04 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 install the timezonedb extension (http://pecl.php.net/timezonedb) to obtain the latest timezone rules.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 20:01:32 2025 UTC