PHP Time

The time function of PHP, and Example of usage.

The time(); function of PHP, will output the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).

Example Usage

Can be used as a timestamp in database enteries, the stamps can be transformed into "readable" dates with the date function.

Examples

<?php
$time = time();
 
echo "<p>" . date('Y-m-d', $time) . "</p>";
?> 

Post comment

Links that you insert are not nofollowed, but will be removed by admins if they are considered spam.

[url=Absolute URL for page]TITLE[/url]

You should insert code boxes around code examples, which will be automatically syntax highlighted.

[code1 html|css|javascript|php|sql]Your Code Here[/code1]

You may want to read our Privacy Policy before submitting your comment.