#19914 [NEW]: October 27 2002 spans 90000 seconds. 1:00AM - 1:59AM are not unique times.
| From: | jsb17 at NOSPAMcornell dot edu | Date: | Tue, 15 Oct 2002 08:26:29 +0000 |
| Subject: | #19914 [NEW]: October 27 2002 spans 90000 seconds. 1:00AM - 1:59AM are not unique times. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-22481@lists.php.net to get a copy of this message | ||
From: jsb17@NOSPAMcornell.edu
Operating system: Windows 98
PHP version: 4.2.3
PHP Bug Type: Date/time related
Bug description: October 27 2002 spans 90000 seconds. 1:00AM - 1:59AM are not unique times.
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 bug report at http://bugs.php.net/?id=19914&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=19914&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=19914&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=19914&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=19914&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=19914&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19914&r=support
Expected behavior: http://bugs.php.net/fix.php?id=19914&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=19914&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=19914&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=19914&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=19914&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=19914&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=19914&r=isapi