microtime()


 

microtime()

This is the example of PHP microtime function used for returning current Unix timestamp.

This is the example of PHP microtime function used for returning current Unix timestamp.

PHP microtime() Function

microtime() returns the current Unix timestamp with microseconds. microtime function is only available on operating systems that support the gettimeofday() system call. This function returns the string "microsec sec", where sec is the number of seconds since the Unix Epoch (0:00:00 January 1, 1970 GMT), and microsec is the microseconds part. Notice that both parts are returned in units of seconds.

Syntax of microtime() Function PHP

microtime(get_as_float)

Parameter & Description of microtime() Function PHP

get_as_float - this is an optional parameter that is used for returning the result in float while the default result is in string. 

Example on microtime() Function PHP

<?php
echo(microtime());
?>

The output of the code above could be:
0.45863896 1257598635

Ads