bidvertiser

Monday, September 8, 2008

DATE & TIME Formats

The basic PHP date and time functions let you format timestamps for use in database queries or simply for displaying the date and time in the browser window.
PHP includes the following date and time functions:
date(format)
Returns the current server time, formatted according to a given set of parameters.

checkdate(month, day, year)
Validates a given date. Successful validation means that the year is between 0 and 32767, the month is between 1 and 12, and the proper number of days in each month.

time()
Returns the current server time, measured in seconds since the Epoch or January 1, 1970.
a Prints "am" or "pm“
A Prints "AM" or "PM".
h Hour in 12-hour format (01 to 12)
H Hour in 24-hour format (00 to 23)
g Hour in 12-hour format without a leading zero (1 to 12)
G Hour in 24-hour format without a leading zero (0 to 23)
i Minutes (00 to 59)
s Seconds (00 to 59)
d Day of the month in two digits (01 to 31)
D Day of the week in text (Mon to Sun)
l Day of the week in long text (Monday to Sunday)
F Month in long text (January to December)
n Month in two digits (1 to 12)
Y Year in four digits (2005)
y Year in two digits (05)
s English ordinal suffix (th, nd, st)

No comments: