How to display Unix Time in PHP?

PHP provides the function time() which returns the time passed since January 1,1970. To display the unix time, also called the epoch time


<?php
$seconds = time();
echo $seconds," seconds"
?>

The output will be the number of seconds


1259673210 seconds

Reblog this post [with Zemanta]
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s