PHP time() Function
Description
PHP represents time as the number of seconds that have passed since January 1st 1970 00:00:00 GMT.
time()
gets the current time in epoch format.
Syntax
PHP time() Function has the following syntax.
int time ( void )
Example
Gets the current time in epoch format
<?PHP// w ww .j av a2 s.co m
print time();
$CurrentTime = time();
print $CurrentTime;
?>
For more precise time values, use the microtime()
function.
The code above generates the following result.