Format character |
Returned values |
Description |
r |
Thu, 21 Dec 2000 16:01:07 +0200 |
RFC 822 formatted date |
w |
0 (for Sunday) through 6 (for Saturday) |
Numeric representation of the day of the week |
D |
Mon through Sun |
A textual representation of a day, three letters |
l (lowercase 'L') |
Sunday through Saturday |
A full textual representation of the day of the week |
j |
1 through 31 |
Day of the month without leading zeros |
d |
01 through 31 |
Day of the month, 2 digits with leading zeros |
S |
st, nd, rd or th. Works well with j |
English ordinal suffix for the day of the month, 2 characters |
t |
28 through 31 |
Number of days in the given month |
n |
1 through 12 |
Numeric representation of a month, without leading zeros |
m |
01 through 12 |
Numeric representation of a month, with leading zeros |
M |
Jan through Dec |
A short textual representation of a month, three letters |
F |
January through December |
A full textual representation of a month, such as January or
March |
y |
Examples: 99 or 03 |
A two digit representation of a year |
Y |
Examples: 1999 or 2003 |
A full numeric representation of a year, 4 digits |
L |
1 if it is a leap year, 0 otherwise. |
Whether it's a leap year |
W |
Example: 42 (the 42nd week in the year) |
ISO-8601 week number of year, weeks starting on Monday (added in PHP
4.1.0) |
z |
0 through 366 |
The day of the year |
U |
-2147483646 through 2147483647 |
Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) |
B |
000 through 999 |
Swatch Internet time |
g |
1 through 12 |
12-hour format of an hour without leading zeros |
G |
0 through 23 |
24-hour format of an hour without leading zeros |
h |
01 through 12 |
12-hour format of an hour with leading zeros |
H |
00 through 23 |
24-hour format of an hour with leading zeros |
i |
00 through 59 |
Minutes with leading zeros |
s |
00 through 59 |
Seconds, with leading zeros |
a |
am or pm |
Lowercase Ante meridiem and Post meridiem |
A |
AM or PM |
Uppercase Ante meridiem and Post meridiem |
O |
Example: +0200 |
Difference to Greenwich time (GMT) in hours |
T |
Examples: EST, MDT ... |
Timezone setting of this machine |
Z |
-43200 through 43200 |
Timezone offset in seconds. The offset for timezones west of UTC is
always negative, and for those east of UTC is always positive. |
I (capital i) |
1 if Daylight Savings Time, 0 otherwise. |
Whether or not the date is in daylights savings
time |