PHP itself is a simple and powerful language, and the PHP date format is quite commonly used, so I studied the PHP date format and shared it with you here. I hope it will be useful to everyone. The PHP language has core features such as powerful string and array processing capabilities, and has greatly improved support for object-oriented programming (PHP5 and above).
1, leap year, week, day
echo date('L');
Whether this year is a leap year: 0
echo date('l');
Today is: Tuesday
echo date('D');
Today is: Tue
Capital L indicates whether this year is a leap year, Boolean value, returns 1 if true, otherwise 0; lowercase l indicates Today is the full English version of the day of the week (Tuesday); and a capital D is used to represent the 3-character abbreviation of the day of the week (Tue).
echo date('w');
Today's week: 2
echo date('W');
This week is the 06th week of the year. The lowercase w represents the day of the week in numeric form means that a capital W represents the number of weeks in the year.
echo date('t');
This month has 28 days
echo date('z');
Today is the 36th day of this year. The lower case t represents the number of days in the current month. A lowercase z indicates the day of the year today is.
2, others
echo date('T');
UTC
uppercase T represents the time locale of the server
echo date('I' );
0
Capital I means to determine whether it is daylight saving time, if true, return 1, otherwise 0 The total number of seconds from January 1st to the present is the UNIX timestamp of the Unix time epoch.
echo date('c');
2007-02-06T14:24:43+00:00
Lowercase c represents the ISO8601 date, the date format is YYYY-MM-DD, separated by the letter T Date and time, the time format is HH:MM:SS, and the time zone is expressed using the offset from Greenwich Mean Time (GMT).
echo date('r');
Tue, 06 Feb 2007 14:25:52 +0000
Lowercase r represents the RFC822 date. The small date() function shows the power and charm of PHP. Compare it to ASP, haha.