PHP gettimeofday()Functions
PHP Date/Time Reference Manual
Examples
Return the current time:
<?php
// Print the array from gettimeofday()
print_r(gettimeofday());
// Print the float from gettimeofday()
echo gettimeofday(true);
?>
// Print the array from gettimeofday()
print_r(gettimeofday());
// Print the float from gettimeofday()
echo gettimeofday(true);
?>
Run example »
Definition and Usage
The gettimeofday() function returns the current time.
Syntax
gettimeofday(return_float);
| Parameters | Description |
|---|---|
| return_float | Optional. When set to TRUE, a float is returned instead of an array. Default is FALSE. |
Technical Details
| Return value: | By default, returns an associative array with the following array keys: R
|
|---|---|
| PHP Version: | 4+ |
| Changelog: | PHP 5.1.0: Added thereturn_floatparameter. |
PHP Date/Time Reference Manual Other Extensions