php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25789 30th, march 2003 seems to have only 23 hours
Submitted: 2003-10-08 06:55 UTC Modified: 2003-10-08 07:03 UTC
From: drow at gmx dot at Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.3.3 OS: Windows XP
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: drow at gmx dot at
New email:
PHP Version: OS:

 

 [2003-10-08 06:55 UTC] drow at gmx dot at
Description:
------------
30th, march has only 23 hours. 2 o'clock is missing :)

using:
- php 4.3.3 with default config
- Windows XP with SP1 and all important updates found on windowsupdate.microsoft.com

Reproduce code:
---------------
// time is 30th, march 2003
$time = mktime( 0,0,0, 3, 30, 2003 );
echo date( 'm/d/Y (H:i:s)', $time );
echo "<br>\n";

// show gap
for( $i = 0; $i < 2; $i++ ) {
	$time += 60*60;
	echo date( 'm/d/Y (H:i:s)', $time );
	echo "<br>\n";
}

echo "<hr>\n";

// reset to 30th, March 2003 (01:59:59)
$time = mktime( 1,59,59, 3, 30, 2003 );
echo date( 'm/d/Y (H:i:s)', $time );
echo "<br>\n";

// show gap
$time++;
echo date( 'm/d/Y (H:i:s)', $time );
echo "<br>\n";

Expected result:
----------------
03/30/2003 (00:00:00)<br>
03/30/2003 (01:00:00)<br>
03/30/2003 (02:00:00)<br>
<hr>
03/30/2003 (01:59:59)<br>
03/30/2003 (02:00:00)<br>

Actual result:
--------------
03/30/2003 (00:00:00)<br>
03/30/2003 (01:00:00)<br>
03/30/2003 (03:00:00)<br>
<hr>
03/30/2003 (01:59:59)<br>
03/30/2003 (03:00:00)<br>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-08 06:59 UTC] sniper@php.net
We are happy to tell you that you just discovered Daylight Savings
Time. For more information see:
http://webexhibits.org/daylightsaving/b.html
Instead of using mktime/date consider using gmmktime and gmdate which do
not suffer from DST.

*sigh*

 [2003-10-08 07:03 UTC] drow at gmx dot at
oh, I'm sorry, didn't know that I was using the wrong function...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 14:01:29 2024 UTC