PHP Include PHP DATE handle dates with php
How does the date () function of php?
It 's a very simple function while the basic syntax is: date (' Y \u200b\u200bm d ') This will print
2007 01 10 . Want to date with hyphens? here it is! date ('Ym-d').
Simple no?
And here's all the syntax!
a - "am" or "pm"
A - "AM" or "PM"
B - Swatch Internet time
d - day of the month, 2 digits without neglecting the zero ie "01" to "31"
D - day of the week, textual, Three letters, ie "Fri"
F - month, textual, long; ie "January"
g - hour, 12-hour format without leading zeros, ie "1" to "12"
G - hour, a 24 without any zero-hours, ie "0" to "23"
h - hour, 12-hour format, ie "01" to "12"
H - hour, 24-hour format, ie "00" " 23 "
i - minutes; ie" 00 "to" 59 "
I (large) -" 1 "if there is daylight savings time," 0 "otherwise.
j - day of the month without leading zeros, ie "1" to "31"
l ('L') - day of the week, textual, long; ie "Friday"
L - boolean for whether it is a year leap, ie "0" or "1"
m - month; ie "01" to "12"
M - month, textual, 3 letters, ie "Jan"
n - month without leading zeros, ie "1" to "12"
O - Difference in hours from Greenwich time zone, ie "+0200"
r - RFC 822 formatted date; ie "Thu, 21 Dec 2000 16:01:07 +0200" (added in PHP 4.0.4)
s - seconds, ie "00" to "59"
S - English ordinal suffix for day of the month, 2 characters, ie "th", "nd"
t - number of days in the given month, ie "28" to "31"
T - Time zone of this machine, ie " MDT "
U - seconds since the epoch since
w - day of the week, numeric, ie" 0 "(Sunday) to" 6 "(Saturday)
W - ISO-8601 Week number of year, weeks starting on Monday (added in PHP 4.1.0) (Saturday)
Y - year, 4 digits, ie "1999"
y - year, 2 digits, ie "99"
z - day of the year, ie "0" to "365"
Z - Time in seconds (ie "-43200" to "43200"). The time zone west of UTC is always negative, and those to the east is always positive.
0 comments:
Post a Comment