PHP time()Functions

PHP Date/TimePHP Date/Time Reference Manual

Examples

Returns the Unix timestamp of the current time, and formats it as a date:

<?php
$t=time();
echo($t . "<br>");
echo(date("Y-m-d",$t));
?>

Run Example »

Definition and Usage

The time() function returns 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/TimePHP Date/Time Reference Manual Other Extensions