Day |
--- |
--- |
D |
The day of the month, which has two digits leading to zero |
01 to 31 |
J |
The day of the month, with no leading zero |
1 to 31 |
S |
English suffix after the number of days per month, 2 characters |
St, nd, rd or th. Can be used with j |
Z |
The day of the year. |
0 to 366 |
Week |
--- |
--- |
L (lowercase letters of "L) |
Day of week, complete text format |
Sunday to Saturday |
D |
The day of the week. The text indicates three letters. |
Mon to Sun |
N |
The day of the week represented by a number in the ISO-8601 format (new in PHP 5.1.0) |
1 (Monday) to 7 (Sunday) |
W |
The day of the week, represented by a number |
0 (Sunday) to 6 (Saturday) |
W |
The week of the year in ISO-8601 format, starting from Monday each week (new in PHP 4.1.0) |
Example: 42 (42nd weeks of the current year) |
Month |
--- |
--- |
F |
The month in the complete text format, such as January or March. |
January to December |
M |
Number indicates the month, with a leading zero |
01 to 12 |
M |
The month abbreviated to three characters. |
Jan to Dec |
N |
Number indicates the month, with no leading zero |
1 to 12 |
T |
Number of days in a given month |
28 to 31 |
Year |
--- |
--- |
L |
Is it a leap year? |
If the leap year is 1, otherwise it is 0 |
O |
The number of years in ISO-8601 format. This is the same as Y, except that the week number (W) of ISO belongs to the previous year or the next year. (New PHP 5.1.0) |
Examples: 1999 or 2003 |
Y |
The year in which the four digits represent the complete number. |
Example: 1999 or 2003 |
Y |
A two-digit year |
Example: 99 or 03 |
Time |
--- |
--- |
A |
Morning and afternoon values in lower case |
Am or pm |
A |
Upper-case morning and afternoon values |
AM or PM |
B |
Swatch Internet standard |
000 to 999 |
G |
Hour, 12-hour format, no leading zero |
1 to 12 |
G |
Hour, in 24-hour format, no leading zero |
0 to 23 |
H |
Hour, 12-hour format, with leading zero |
01 to 12 |
H |
Hour, in 24-hour format, with a leading zero |
00 to 23 |
I |
Minutes with a leading zero |
00 to 59> |
S |
Number of seconds, with a leading zero |
00 to 59> |
Time zone |
--- |
--- |
E |
Time zone ID (new in PHP 5.1.0) |
Example: UTC, GMT, Atlanta/Azores |
I |
When it is enabled or not |
If this parameter is set to 1, otherwise it is set to 0. |
O |
Hours different from Greenwich Mean Time |
For example: + 0200 |
P |
Difference from Greenwich Mean Time (GMT), separated by colons between hours and minutes (new in PHP 5.1.3) |
Example: + |
T |
Time zone of the local machine |
For example, EST and MDT are in full text format in Windows. for example, "Eastern Standard Time" is displayed in Chinese "). |
Z |
The number of seconds of the time difference offset. The time zone offset to the west of UTC is always negative, and the time zone offset to the east of UTC is always positive. |
-43200 to 43200 |
Complete date/time |
--- |
--- |
C |
Date in ISO 8601 format (new in PHP 5) |
2004-02-12T15: 19: 21 + 00: 00 |
R |
Date in RFC 822 format |
Example: Thu, 21 Dec 2000 16:01:07 + 0200 |
U |
The number of seconds since the Unix epoch (January 1 1970 00:00:00 GMT), that is, the timestamp. |
SeeTime () |