Home Tutorial Php Phpdate microtime()

 
 

Share on Google+Share on Google+
microtime()
Posted on: August 28, 2009 at 12:00 AM
Advertisement
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

Advertisement

Related Tags for microtime():


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: August 28, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com