time

int time(void) 

Returns the current time as a UNIX timestamp.

Returns:

Current UNIX timestamp

Description:

This function returns the number of seconds since the UNIX epoch. It’s identical to calling mktime() with no arguments or using date('U').

Version:

PHP 3, PHP 4

See also:

mktime() 
gmmktime() 
Example:
				
Print the current date
$my_time = time(); 
print(date('D F d Y', $my_time)); 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.