php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26970 microtime() <> time() after changing the system time
Submitted: 2004-01-19 15:38 UTC Modified: 2004-01-19 18:47 UTC
From: TomSoftware at gmx dot de Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.3.4 OS: win2k
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: TomSoftware at gmx dot de
New email:
PHP Version: OS:

 

 [2004-01-19 15:38 UTC] TomSoftware at gmx dot de
Description:
------------
The command time() and the microtime() command return a different value.
It seems to be one day different (60s * 60 * 24 = 86400).

Perhaps it's a Time zone problem (Germany +1h but not +1Day).


Regards Thomas


Reproduce code:
---------------
<?PHP

echo time() ."<br>";

list($usec, $sec) = explode(" ",microtime()); 
echo $sec ."<br>";

echo (time() - $sec) /60 /60 /24;  //-- = 1 Day

?>

Expected result:
----------------
time() == microtime() 

Actual result:
--------------
time() == (microtime()+86400)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-19 16:08 UTC] TomSoftware at gmx dot de
Sorry (it's only a small bug)

I had change my system time by +1 day
Result: Only time() returns the new time. Microtime() returns the old time.

Regards Thomas
 [2004-01-19 18:47 UTC] sniper@php.net
The microtime is whatever the system libc tells it is.
Not PHP bug.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Dec 03 15:00:01 2025 UTC