PHP gettimeofday() Function

PHP gettimeofday Function


Definition : 

In php gettimeofday() Function is inbuilt function.PHP gettimeofday() function is used to return the current time. It returns an associative array containing the data returned from the system call, that is the current time. It accepts only a single parameter $return_float which is optional. It returns an associative array containing the current time and return float value if $return_float parameter is set.

Syntax

    getdate(timestamp)

Parameter
Parameter Description
timestamp Optional. Specifies an integer Unix timestamp. Default is the current local time (time())

Given below example Return the current time:

Output :