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
$7.95/mo SEO Hosting
Premium Website Design
WEB BUILDING
Download XML Editor
FREE Website BUILDER
Free Website Templates Free CSS Templates
Make Your Own Website
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