Date Format description
All functions in php are in the unix era, that is, since January 1, 1970. The date is the number of seconds from this time. When a function is called in seconds, it is treated as a timestamp (times *** p.
Local time functions
1. string date (string format, inieger times ***** p)
This function returns a time string controlled by string format.
For example:
<?
Print (date ("y, m, D"); // output current, year, month, and day.
Print (date ("y, m, D,", 60*60*24*365*10); // output for April 1, January 1, 1980.
?>
Maybe you will ask, why is there no times *** p? If times ***** p is null or is not written, the current time is used. times ***** p.
The control operator of the year: y --- four-digit year y --- two-digit year
Indicates the control operator of the month: m --- From month f --- English month name m --- abbreviated month name
Control operator for day: d --- date j in the month with 0 in front -- date without 0 in front
Indicates the control Letter of the week: l -- English week d -- abbreviation of the week
The hour Controller: h -- hour from 1 to 12 h --- hour from 0 to 23
Indicates the control letter a --- am or pm of the previous afternoon.
Indicates the minute Controller: I --- value 00-59
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.
For example:
<? $current_date=getdate(); print($current_date("hours")); print($current_date("minutes"); print($current_date("seconds"); ?>
Note:
Element description
Hour in the 24-hour format
Date in mday month
Minutes
Month in the form of mon
Full name of month
Seconds
The number of weeks in the format of 0 to 6 for wday
Weekday
Year
0 timestamp is the number of seconds from January 1, January 1, 1970 to the present.
A date in the digit format of a year in yday
3. boolean checkdate (integer month, integer day, integer year)