Easy Tutorial
❮ Php Imagecolorat Php Intro ❯

PHP microtime() Function

PHP Date/Time Reference Manual

Example

Returns the microseconds part of the current Unix timestamp:

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

Definition and Usage

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

Syntax

Parameter Description
get_as_float Optional. When set to TRUE, the function should return a floating-point number; otherwise, it returns a string. Default is FALSE.

Technical Details

Return Value: By default, it returns a 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. If the get_as_float parameter is set to TRUE, it returns a floating-point number representing the current time in seconds with microsecond precision since the Unix Epoch.
PHP Version: 4+
--- ---
Changelog: PHP 5.0.0: Added the get_as_float parameter.
--- ---
❮ Php Imagecolorat Php Intro ❯