PHP Date QuickList

First we need to breifly go over how the date function works. It is fairly straightforward:

string date ( string format [, int timestamp] )

You simply pass a string containing the date format, and a timestamp if you don’t want to use the current time. Something to note: Any character that isn’t recognized by the date function will be displayed as is.

Character     Description
F Full text of month (January)
n Number of the month (1)
j Number of day (1)
d Number of day (01)
Y Full year (2005)

With the individual characters you can create full formats. Below are the formats that I use most frequently:

Format     Example     PHP Code
n/j/Y 10/8/2005

date(“n/j/Y”)

F j Y October 8 2005

date(“F j Y”)

For a full list of all the recognized characters visit the PHP: date – Manual. This list is only a list of the characters I use frequently myself.