php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43025 PHP does not detect daylight saving
Submitted: 2007-10-18 20:47 UTC Modified: 2007-10-18 20:56 UTC
From: maximo at granweb dot net Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.4 OS: Linux
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: maximo at granweb dot net
New email:
PHP Version: OS:

 

 [2007-10-18 20:47 UTC] maximo at granweb dot net
Description:
------------
I have 4 servers all of then are setup to a time zone with daylight saving and I can see that on console but php says the server is not in daylight saving time.
If I execute the command (date +"%z %Z") I get the result "-0200 BRST" and thats right because we are currently on daylight saving time what make my time zone pass from "-0300" to "-0200" but PHP doesn't see that and that happen on all my linux servers.

Reproduce code:
---------------
echo date_default_timezone_get() . "<br>";
echo date("d.m.y H:i I T") . "<br>";
$localtime_assoc = localtime(time(), true);
print_r($localtime_assoc);


Expected result:
----------------
America/Sao_Paulo
18.10.07 17:39 1 BRST
Array ( [tm_sec] => 53 [tm_min] => 39 [tm_hour] => 17 [tm_mday] => 18 [tm_mon] => 9 [tm_year] => 107 [tm_wday] => 4 [tm_yday] => 290 [tm_isdst] => 1 ) 

Actual result:
--------------
America/Sao_Paulo
18.10.07 17:39 0 BRT
Array ( [tm_sec] => 53 [tm_min] => 39 [tm_hour] => 17 [tm_mday] => 18 [tm_mon] => 9 [tm_year] => 107 [tm_wday] => 4 [tm_yday] => 290 [tm_isdst] => 0 ) 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-18 20:56 UTC] derick@php.net
Please install http://pecl.php.net/package/timezonedb which has an updated database.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 26 22:00:03 2025 UTC