Featured Post

Google Website Optimizer Results

I just wanted to share the results gained from using Google new Website Optimizer Tool. I set up an experiment on www.voodoochilli.net the experiment consisted of a change of graphic, simply increasing the brightness of the register button slightly to make it a more prominent feature to see if more people...

Read More

Introduction to PHP Date

Posted by Voodoochilli | Posted in Development | Posted on 11-01-2007

Tags:

0

I thought for this blog item I would write about something fairly simple, that should help a lot of people. PHP has a very useful built in function simply called date(). Guess what it does? That’s right it returns the current date, but it can be used with other functions to do much more.

Here is a very simple example of its usage:

echo date(“F j, Y, g:i a”);

This will print out the today’s date in this format:

Month, Day, Year, Hour, Minutes and AM or PM

If you simply wanted to show the time and not the full date you would use:

echo date(“g:i a”);

For a more detail on using the PHP date() function visit www.php.net/date

Write a comment