ID:               36688
 Updated by:       [EMAIL PROTECTED]
 Reported By:      phil at adigital dot com dot mx
-Status:           No Feedback
+Status:           Bogus
 Bug Type:         Date/time related
 Operating System: Win XP and Linux FC4
 PHP Version:      5.1.2
 New Comment:

The United States changed Daylight Savings Time start/end:
  <= 2006:  1st Sunday in April at 2:00 am
  >= 2007:  2nd Sunday in March at 2:00 am

TEST:
-----
<?php
//$t1 = strtotime('2006-03-05 02:30:00');  // 1141543800
$t1 = strtotime('2007-03-04 01:30:00');  // 1172989800

//$t2 = strtotime('2006-03-05 01:30:00');  // 1141540200
$t2 = strtotime('2007-03-04 02:30:00');  // 1172993400

$step = 60 * 60 * 24 * 7;  // Increment one week

for ($i = 0; $i < 6; $i++) {
    echo $t1 . ' = ' . date('r', $t1) . "\n";
    echo $t2 . ' = ' . date('r', $t2) . "\n";
    echo "---\n";
    $t1 = $t1 + $step;
    $t2 = $t2 + $step;
}
?>

OUTPUT:
-------
1172989800 = Sun, 04 Mar 2007 01:30:00 -0500
1172993400 = Sun, 04 Mar 2007 02:30:00 -0500
---
1173594600 = Sun, 11 Mar 2007 01:30:00 -0500
1173598200 = Sun, 11 Mar 2007 03:30:00 -0400
---
1174199400 = Sun, 18 Mar 2007 02:30:00 -0400
1174203000 = Sun, 18 Mar 2007 03:30:00 -0400
---
1174804200 = Sun, 25 Mar 2007 02:30:00 -0400
1174807800 = Sun, 25 Mar 2007 03:30:00 -0400
---
1175409000 = Sun, 01 Apr 2007 02:30:00 -0400
1175412600 = Sun, 01 Apr 2007 03:30:00 -0400
---
1176013800 = Sun, 08 Apr 2007 02:30:00 -0400
1176017400 = Sun, 08 Apr 2007 03:30:00 -0400
---


Previous Comments:
------------------------------------------------------------------------

[2006-10-30 16:57:34] gxt3 at dowling dot edu

I can confirm the bug of date() shifting one hour. I use 
date in a calendar app :
date("d",(mktime(0,0,0,$month,$day,$year)+$m*24*60*60))
where m goes from 0 to 1 and $month, $day, $year are given 
by the user. So it is either mktime or date problem.
for the last week of November the timestamps returned are:
27 Nov: 1161921600
28 Nov: 1162008000
29 Nov: 1162094400
30 Nov: 1162180800 (Bug here it is 23:00PM of 29th yet )
31 Nov: 1162267200 (Bug still here )
01 Oct: 1162353600 (Bug still present)
02 Oct: 1162440000 (Same here)
----
The following week (my weeks start on Friday) the times are 
back to normal.
The system is slackware 10.2 and I have not seen this bug in 
the past year. This is the first week that it occurs.

------------------------------------------------------------------------

[2006-03-19 01:00:04] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------

[2006-03-11 16:52:51] [EMAIL PROTECTED]

What timezone did you configure your server to use? (date.timezone
php.ini setting).

------------------------------------------------------------------------

[2006-03-10 23:48:22] phil at adigital dot com dot mx

Description:
------------
date("Y-m-d H:i:s", 1175403600);
shows: 2007/4/1 00:00:00
Should be: 2007/3/1 23:00:00

the hour is shift 1 hour in PHP from march/11/2007 to april/1/2007 (20
days of 1 hour diff !)

The same problem repeat 2008, 2009, 2010, 2011, etc, but the beginning
of problem is +/- 5 days and ending problem too +/- 5 days

It seems the problem is not occuring before 3/1/2007

I thought first it was maybe a daylight savings problem 
BUT:
- it happens on our redhat 8 servers in US (ev1), local servers (FC4)
AND windows XP
- the start and end date of the problem is quite random in a period ,
daylights are quite fixed
- It doesnt happen before 3/1/2007

SO i guess it's a bad bug somewhere

the result *must* be same as unix_timestamp C++ function no ?
It is not

Thx !

Reproduce code:
---------------
print date("Y-m-d H:i:s", 1175403600);  // bad +1 hour
print date("Y-m-d H:i:s", 1238417200);  // bad +1 hour

print mktime(0,0,0,4,1,2007); 


Expected result:
----------------
2007/3/1 23:00:00
2009-03-30 06:46:40
1175407200

Actual result:
--------------
2007/4/1 00:00:00
2009-03-30 07:46:40
1175403600


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=36688&edit=1

Reply via email to