Day |
--- |
--- |
D |
Day of the month, 2 digits with leading zeros |
to |
D |
A textual representation of a day, three letters |
Mon through Sun |
J |
Day of the month without leading zeros |
1 to |
l (lowercase ' l ') |
A full textual representation of the day of the week |
Sunday through Saturday |
N |
ISO-8601 numeric representation of the Day of the week (added in PHP 5.1.0) |
1 (for Monday) through 7 (for Sunday) |
S |
中文版 ordinal suffix for the day of the month, 2 characters |
St, nd, Rd or th. Works well with J |
W |
Numeric representation of the day of the week |
0 (for Sunday) through 6 (for Saturday) |
Z |
The day's (starting from 0) |
0 through 365 |
Week |
--- |
--- |
W |
ISO-8601 Week number of year, weeks starting on Monday (added in PHP 4.1.0) |
Example: (the 42nd Week in the year) |
Month |
--- |
--- |
F |
A full textual representation of a month, such as January or March |
January through December |
M |
Numeric representation of a month, with leading zeros |
through |
M |
A short textual representation of a month, three letters |
Jan through Dec |
N |
Numeric representation of a month, without leading zeros |
1 through |
T |
Number of days in the given month |
through |
Year |
--- |
--- |
L |
Whether it ' s a leap year |
1 If it is a leap year, 0 otherwise. |
O |
ISO-8601 year number. This have the same value as Y, except if the ISO week number (W) belongs to the previous or next yea R, that year is used instead. (added in PHP 5.1.0) |
Examples: 1999 or 2003 |
Y |
A full numeric representation of a year, 4 digits |
Examples: 1999 or 2003 |
Y |
A digit representation of a year |
Examples: or |
Time |
--- |
--- |
A |
lowercase Ante meridiem and Post Meridiem |
am or pm |
A |
Uppercase Ante Meridiem and Post Meridiem |
AM or PM |
B |
Swatch Internet Time |
through 999 |
G |
12-hour format of an hour without leading zeros |
1 through |
G |
24-hour format of an hour without leading zeros |
0 through |
H |
12-hour format of an hour with leading zeros |
through |
H |
24-hour format of an hour with leading zeros |
xx through |
I |
Minutes with leading zeros |
xx to |
S |
Seconds, with leading zeros |
xx through |
U |
Microseconds (added in PHP 5.2.2) |
Example: 654321 |
Timezone |
--- |
--- |
E |
Timezone identifier (added in PHP 5.1.0) |
Examples: UTC, GMT, atlantic/azores |
I (capital i) |
Whether or not the date was in daylight saving time |
1 If daylight saving time, 0 otherwise. |
O |
Difference to Greenwich time (GMT) in hours |
Example: +0200 |
P |
Difference to Greenwich time (GMT) with colon between hours and minutes (added in PHP 5.1.3) |
Example: +02:00 |
T |
Timezone abbreviation |
Examples: EST, MDT ... |
Z |
Timezone offset in seconds. The offset for TimeZones west of UTC is all negative, and for those east of UTC are always positive. |
-43200 through 50400 |
Full Date/time |
--- |
--- |
C |
ISO 8601 Date (added in PHP 5) |
2004-02-12t15:19:21+00:00 |
R |
?? RFC 2822 Formatted Date |
Example: Thu, Dec 16:01:07 +0200 |
U |
Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) |
See also Time () |