|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 12:00:01 2025 UTC |
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?