W3Schools.com

PHP time() Function


PHP Date Reference Complete PHP Date Reference

Definition and Usage

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

Syntax

time(void)

Parameter Description
void Optional.


Tips and Notes

Note: Calling this function is identical to calling mktime() with no parameters, or calling date("U").


Example

<?php
$t=time();
echo($t . "<br />");
echo(date("D F d Y",$t));
?>

The output of the code above could be:

1138618081
Mon January 30 2006


PHP Date Reference Complete PHP Date Reference
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE