PHP » Miscellaneous » microtime()

Syntax:
mixed microtime([bool return_float])
return_float
Whether to return the result as a float.

Returns the number of seconds and microseconds since January 1, 1970.

This function returns the system time as a number of seconds since January 1, 1970. By defult, the result is returned as a string with the microsecond component first (as a number between 0 and 1) followed by a space and the second component. As of PHP 5, the optional return_float parameter can be specified to get the result as a float with the total number of microseconds instead.

Examples

Code:
print microtime() . "<br>";
print microtime(TRUE);
Output:
0.72881200 1079566000
1079566000.7288
Explanation:

The current time is printed as a string and as a float. Note that the latter format is only available in PHP 5 and up.

See Also: