X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP time() Function

PHP Date/Time PHP Date/Time Reference

Example

Return the current time as a Unix timestamp, then format it to a date:

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

Run example »

Definition and Usage

The time() function returns the current time in 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 current time as a Unix timestamp
PHP Version: 4+


PHP Date/Time PHP Date/Time Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook