Del.Icio.Us Digg Technorati Reddit Stumble Facebook

Time Function

Posted on 21 Feb 2008 20:04:34 by John Slater in PHP

To follow up from the PHP date tutorial i will explain how exactly you output the current time and date's Unix timestamp, this can be very useful when inserting things into a database etc.

It's very simple to do and only requires one function, the time function.

<?
echo time();
?>

That's it.

I use the time() function all the time because it allows me to put a code into the database that can be formatted into any date format i want.


Share This Story:
digg del.icio.us Technorati reddit furl stubleupon Facebook