PHP gettimeofday () function
PHP Date / Time Reference Manual
Examples
Returns 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);
?>
Running instance »
Definition and Usage
gettimeofday () function returns the current time.
grammar
gettimeofday( return_float);
参数 | 描述 |
---|---|
return_float | 可选。当设置为 TRUE 时,返回一个浮点数,而不是一个数组。默认是 FALSE。 |
technical details
return value: | Default returns an associative array, the array with the following keys: R
|
---|---|
PHP version: | 4+ |
Update log: | PHP 5.1.0: Added return_float parameters. |
PHP Date / Time Reference Manual