php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41653 Daylight saving start date not correct
Submitted: 2007-06-11 16:13 UTC Modified: 2007-06-21 13:14 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: stvanhouwelingen at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.3 OS: Linux
Private report: No CVE-ID: None
 [2007-06-11 16:13 UTC] stvanhouwelingen at gmail dot com
Description:
------------
In PHP 5.2.3 the daylight saving start date for time zone The Netherlands is not correct for the years 1977, 1978 and 1979
This used to work correctly in PHP 4.
Below script should show 23 hours time difference for all given dates, but somehow this is not happening in 1977, 1978 and 1979.

Reproduce code:
---------------
<?
$dates = array(
  '1977-04-03',
  '1978-04-02',
  '1979-04-01',
  '1980-04-06',
  '1981-03-29',
  '1982-03-28',
  );

foreach($dates as $date)
{
  $ts1 = strtotime($date);
  $ts2 = strtotime('+1 day',$ts1);
  $diff = ($ts2-$ts1)/3600;
  echo "$date => $diff\n";
}
?>

Expected result:
----------------
1977-04-03 => 23
1978-04-02 => 23
1979-04-01 => 23
1980-04-06 => 23
1981-03-29 => 23
1982-03-28 => 23


Actual result:
--------------
1977-04-03 => 24
1978-04-02 => 24
1979-04-01 => 24
1980-04-06 => 23
1981-03-29 => 23
1982-03-28 => 23



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-11 17:54 UTC] derick@php.net
What is the output of:

echo date_default_timezone_get(), "\n";
 [2007-06-11 18:47 UTC] stvanhouwelingen at gmail dot com
Hi Derick

The output of 
echo date_default_timezone_get(), "\n";
is "Europe/Berlin"
This works only with PHP5, of course.

Best regards,
Steven.
 [2007-06-11 19:36 UTC] stvanhouwelingen at gmail dot com
If I use
 date_default_timezone_set('Europe/Amsterdam')
then the output is correct. 
However, I would expect that PHP5 generates the same results as PHP4 on the same machine with the same php.ini?
 [2007-06-21 13:14 UTC] derick@php.net
No, that is not correct. PHP 5.1 have much better support for timezones and it can now distinguish between Germany and the Netherlands for this.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 14:01:33 2025 UTC