php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28425 microtime returns old system time
Submitted: 2004-05-18 00:02 UTC Modified: 2004-07-30 11:55 UTC
From: bela at up2you dot se Assigned: wez (profile)
Status: Closed Package: Date/time related
PHP Version: 4.3.6 OS: XP professional
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bela at up2you dot se
New email:
PHP Version: OS:

 

 [2004-05-18 00:02 UTC] bela at up2you dot se
Description:
------------
microtime() is not affected after changing the system time. The bug is verified on IIS and PHP4isapi.dll. 
The only way to get right system time is to restart the IIS server.

The example shows when changing system time from 23:48:13 to 23:38:13.

Reproduce code:
---------------
<?php
header("Content-type: text/plain");
list($usec, $sec) = explode(" ", microtime()); 
print date("Y-m-d H:i:s", $sec) . "\r\n";
print date("Y-m-d H:i:s", time());
?>

Expected result:
----------------
2004-05-17 23:38:13
2004-05-17 23:38:13



Actual result:
--------------
2004-05-17 23:48:13
2004-05-17 23:38:13





Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-18 01:21 UTC] wez@php.net
There are some nasty static variables in use in our gettimeofday() implementation.

I've a feeling that the fix would be something that will only work in win98 and higher, so it might not be possible to fix in PHP 4.3.x, but be fair game for PHP 5.

Assigning to myself; I'll look at it later in the week.
 [2004-07-29 05:31 UTC] wez@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

ok, so maybe it took longer than a week...
Please try next PHP 5.1 (unstable) snapshot dated after this message.
If you confirm that it is working correctly, we can look into back-porting the fix to PHP 4.3. 
 [2004-07-30 11:49 UTC] bela at up2you dot se
Tested next PHP 5.1 (unstable) snapshot and now it works correctly.
 [2004-07-30 11:55 UTC] edink@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 18:01:28 2024 UTC