Parameters of the phpdate () function are described in detail. in php, the date () function can be used to obtain the time and date. it may be a commonly used function. next I will share with you the date () function () function 1 is an unknown parameter.
Date () function, this function is familiar with, the code is as follows:
Echo ("Result with date ():
");
Echo (date ("l ")."
");
Echo (date ("l dS of f y h: I: s ")."
");
Echo ("Oct 3,1975 was on a". date ("l", mktime ))."
");
Echo (date (DATE_RFC822 )."
");
Echo (date (DATE_ATOM, mktime ))."
");
// Open source code phpfensi.com
Echo ("Result with gmdate ():
");
Echo (gmdate ("l ")."
");
Echo (gmdate ("l dS of f y h: I: s ")."
");
Echo ("Oct 3,1975 was on a". gmdate ("l", mktime ))."
");
Echo (gmdate (DATE_RFC822 )."
");
Echo (gmdate (DATE_ATOM, mktime ))."
");
?>
Result with date ():
Wednesday
Wednesday 22nd of December 2010 02:36:18 AM
Oct 3,1975 was on a Friday
Wed, 22 Dec 10 02:36:18 + 0000
1975-10-03T00: 00: 00 + 00: 00
Result with gmdate ():
Wednesday
Wednesday 22nd of December 2010 02:36:18 AM
Oct 3,1975 was on a Friday
Wed, 22 Dec 10 02:36:18 + 0000
1975-10-03T00: 00: 00 + 00: 00
The parameter description of the date () function in the PHP Manual is attached:
A-"am" or "pm"
A-"AM" or "PM"
D-a few days, two digits. if there are less than two digits, fill in the first zero. for example, "01" to "31"
D-the day of the week, with three English letters, for example, "Fri"
F-month, full English name; for example: "January"
H-12 hours, for example, "01" to "12"
H-24 hours, for example, "00" to "23"
Hours in the g-12 hour format. less than two hours do not fill in zero. for example: "1" to 12"
Hours in the G-24-hour format. less than two hours do not fill in zero. for example: "0" to "23"
I-minutes; for example: "00" to "59"
J-a few days, two digits. if less than two digits are left blank, for example, "1" to "31"
L-the day of the week, full name in English; for example: "Friday"
M-month, two digits. if there are less than two digits, add zero in front, for example, "01" to "12"
N-month, two digits. if less than two digits are left blank, for example, "1" to "12"
M-month, with three English letters, for example, "Jan"
S-seconds; for example: "00" to "59"
The end of the S-character is followed by an English sequence, with two English letters, for example, "th", "nd"
T-specifies the number of days in a month, for example, "28" to "31"
U-total seconds
W-number of weeks, for example, "0" (Sunday) to "6" (Saturday)
Y-year, four digits, such as: "1999"
Y-year, two digits, for example, "99"
Z-the day of the year, for example, "0" to "365"