HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP microtime() Function

PHP Date/Time PHP Date/Time Reference

Example

Return the current Unix timestamp with microseconds:

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

Run example »

Definition and Usage

The microtime() function returns the current Unix timestamp with microseconds.


Syntax

microtime(get_as_float);

Parameter Description
get_as_float Optional. When set to TRUE it specifies that the function should return a float, instead of a string. Default is FALSE

Technical Details

Return Value: Returns the string "microsec sec" by default, where sec is the number of seconds since the Unix Epoch (0:00:00 January 1, 1970 GMT), and microsec is the microseconds part. If the get_as_float parameter is set to TRUE, it returns a float representing the current time in seconds since the Unix epoch accurate to the nearest microsecond
PHP Version: 4+
Changelog: PHP 5.0.0: Added the get_as_float parameter


PHP Date/Time PHP Date/Time Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE