Return the current time:
<?php// Print the array from gettimeofday()print_r(gettimeofday());// Print the float from gettimeofday()echo gettimeofday(true);?>The gettimeofday() function returns the current time.
gettimeofday( return_float);
parameter | describe |
---|---|
return_float | Optional. When set to TRUE, returns a floating point number instead of an array. The default is FALSE. |
Return value: | By default, an associative array is returned with the following array key names: R [sec] - Seconds since Unix epoch [usec] - microseconds [minuteswest] - Minutes west of Greenwich [dsttime] - Daylight saving time correction type If the return_float parameter is set to true, a floating point number is returned. |
---|---|
PHP version: | 4+ |
Update log: | PHP 5.1.0: Added return_float parameter. |