Detailed description of date format
All functions in PHP are from the Unix era, that is, starting from January 1, 1970. The date is the number of seconds since this time. When a function calls the number of seconds since then, treat it as a (times****p) timestamp.
Local time function
1. string date(string format,inieger times****p)
This function returns a string representing the time, controlled by string format.
Such as:
print(date("y year m month d day");//Output the current year, month and day.
print(date("y year m month d day",60*60*24*365*10);//Output January 1, 1980.
?>
Maybe you will ask, why is there no times****p? If times****p is empty, or does not write a time, it means using the current time times****p.
Control character representing the year: y---four-digit year y---two-digit year
Control character representing the month: m---month from 1-12 f---English month name m---abbreviated month name
The control character representing the day number: d---the day of the month with 0 in front j--the day number without 0 in front
The control character representing the day of the week: l--English week d--abbreviated week
Control character representing the hour: h--hours from 1 to 12 h---hours from 0 to 23
Control symbol indicating morning and afternoon a ---am or pm a---am or pm
Control character representing minutes: i---value 00-59
Indicates the number of days in a year: z--the number of days in a year
2. array getdate(integer times****p)
This function returns a matrix.
Such as:
<? $current_date=getdate(); print($current_date("hours")); print($current_date("minutes"); print($current_date("seconds"); ?>
Description:
Element Description
hours Hours in 24-hour format
mday Mid-month date
minutes minutes
mon month in numeric form
month Full name of month
seconds seconds
wday Day of the week as a number from 0 to 6
weekday The name of the day of the week
year year
0 timestamp is the number of seconds from January 1, 1970 to the present
yday Numeric date of the year
3. boolean checkdate(integer month,integer day,integer year)