Edit report at https://bugs.php.net/bug.php?id=19914&edit=1

 ID:                 19914
 Comment by:         beakerboy99 at yahoo dot com
 Reported by:        jsb17 at NOSPAMcornell dot edu
 Summary:            October 27 2002 spans 90000 seconds.  1:00AM -
                     1:59AM are not unique times.
 Status:             Bogus
 Type:               Bug
 Package:            Date/time related
 Operating System:   Windows 98
 PHP Version:        4.2.3
 Block user comment: N
 Private report:     N

 New Comment:

I had found a similar "bug" with 2007-11-04 after pulling my hair out trying to 
find whay a URL link wasn't incrementing properly. I found the 90000 seconds 
thing, and then figured out it's due to daylight savings time and the extra 
hour from setting the clocks back.


Previous Comments:
------------------------------------------------------------------------
[2002-10-15 03:28:34] der...@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

------------------------------------------------------------------------
[2002-10-15 03:26:29] jsb17 at NOSPAMcornell dot edu

To whom it may concern,

I noticed you have another October date bug pending, but it was in spanish, and 
I don't understand it.

I believe this is a bug:  October 27, 2002 spans 90000 seconds, rather than 
86400.  Please let me know if I am incorrect.

I have isolated the bug on a page on my server:

http://68.50.50.189/wp_test_stuff/bug.php

"01:00 am 27 Oct 2002" appears twice in the list.

Here is the code used to produce this page:

<?php

//  timestamps are 90000 seconds apart
$debug_seven = mktime(0,0,0,10,27,2002);
echo "10-27-2002 timestamp: $debug_seven<br>";
$debug_eight = mktime(0,0,0,10,28,2002);
echo "10-28-2002 timestamp: $debug_eight<p>";

//begin on october 27, 2002, and increment every hour
for ($ts=1035702000; $ts <= 1035792000; $ts+=3600){
  echo "<br>" . date("h:i a d M Y", $ts);
}

echo "<P><HR><P>";

phpinfo();
echo "<hr>$HTTP_USER_AGENT\n";

?>

If this is a bug, I hope you are able to spend less time fixing it than I spent 
isolating it.

I received the error using a loop to cycle through consecutive days by 
incrementing my timestamp += 86400.

I have changed my code by using this time-expensive kludge, but it works:

//  increment to the next day
$my_timestamp = mktime(0,0,0,
date("m",$my_timestamp),
date("d",$my_timestamp)+1,
date("Y",$my_timestamp));

I hope I have been clear.  Thank you for your time in considering this.  Please 
remove the NOSPAM from my e-mail address when replying

-Jon

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



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

Reply via email to