Date function
Date ($format "$time");
Description
???? Formats $time the specified timestamp using the $format format string pair.
The $format time format string is as follows:
Y???????? 4-bit year
Y???????? 2-bit year
M???????? English abbreviation Month
M???????? Month with leading zeros
D???????? Day of the week of 3 characters
D???????? Date with leading zeros
H???????? 24 Hours of production information
H???????? 12-hour Letter from
I???????? Represents minutes
s???????? Represents seconds
PHP has a very powerful function for time operations. When you stock time information to the data, you typically save a timestamp.
Time Origin: The computer world is set to January 1, 1970 0:0 0 seconds, the time origin
Timestamp: From the time origin to the current number of seconds (JS is the number of milliseconds).
Time zone settings:
Date_default_timezone_set (' PRC ');
?
Mktime (); Gets the timestamp of the specified time
If you want to format the display of any time, you need to use date, but the date's time parameter can only be a timestamp. So you need to use mktime for formatting.
Time (); timestamp
Mktime (hours, seconds, months, days, years);
???? Gets the timestamp at the specified point in time
Example:
Date correlation function