Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP time() Function

PHP time() Function

PHP Date/Time PHP Date/Time Reference Manual

Example

Return the current time as a Unix timestamp and format it as a date:

"); echo(date("Y-m-d",$t)); ?>

Run Example »


Definition and Usage

The time() function returns the current time as the number of seconds since the Unix epoch (January 1 1970 00:00:00 GMT).

Syntax

time();

Technical Details

Return Value: Returns an integer containing the Unix timestamp of the current time.
PHP Version: 4+

PHP Date/Time PHP Date/Time Reference Manual