Return the current time.
<?php // Print the array from gettimeofday() print_r(gettimeofday()); // Print the float from gettimeofday() echo gettimeofday(true); ?> |
The gettimeofday() function retrieves the current time.
gettimeofday(return_float) |
Parameter |
Description |
return_float |
Optional. If set to TRUE, the function returns a float instead of an array. The default is FALSE. |
Return Value: |
By default, the function returns an associative array with the following keys:
[sec]: Seconds since the Unix Epoch [usec]: Microseconds [minuteswest]: Minutes west of Greenwich [dsttime]: Type of DST correction If the return_float parameter is set to true, the function returns a float instead. |
PHP Version: |
4+ |
Changelog: |
PHP 5.1.0: Introduced the return_float parameter. |