php in date The () function uses the most: date (' y-m-d h:i:s ', ());
y - year, four-digit; such as: "",
m - month, two digits, if less than two digits in front of 0; such as: "" " to " three ";
d - a few days, Two digits, if less than two digits, the front 0; such as: " to ",
h - 24 hours of; , such as: "XX" to "",
i - minutes; such as: "XX" to "";;
s - seconds; such as: "00" to "",
time ()-Default to the current time, if you want to indicate a week later, then change to time () +7*24*60*60.
Note: The time here is GMT and Beijing time difference is exactly 8 hours.
If you want to be changed, find the php.ini file (the file in My computer is C:\xampp\php);
There is a line in the ";d ate.timezone=", will ";" Remove, change to "Date.timezone = PRC" (prc:people ' s Republic of China), restart Apache, it is OK.
Other available parameters for the date () function:
A-"AM" or "PM";
A-"AM" or "PM";
D-Days of the week, three English letters; such as: "Fri";
F-month, full name in English; such as: "January";
H-12 hours of the hour; such as: "01" to "12";
G-12 hours of the hour, less than two digits do not fill 0; such as: "1" to 12 ";
G-24 hours of the hour, less than two does not fill 0; such as: "0" to "23";
J-A few days, two digits, if less than two bits do not fill 0; such as: "1" to "31";
L-Day of the week, English full name; such as: "Friday";
N-month, two digits, if less than two digits does not fill 0; such as: "1" to "12";
M-month, three letters of English; such as: "Jan";
S-End With English ordinal number, two English letters; such as: "th", "nd";
T-the number of days in the specified month; such as: "28" to "31";
U-Total number of seconds;
W-Number of days of the week, such as: "0" (Sunday) to "6" (Saturday);
Y-year, two digits; such as: "99";
Z-the day ordinal of a year; such as: "0" to "365".
$t=date () function parameter meaning and time change in PHP