PHP中的10种日期和时间处理函数
1. date()
The date() function is used to format the date and time, and can be used to display the current date and time or to format any given date and time.
2. time()
The time() function returns the current Unix timestamp, which is the number of seconds that have elapsed since January 1, 1970.
3. strtotime()
The strtotime() function is used to parse a date string and convert it into a Unix timestamp.
4. mktime()
The mktime() function is used to create a Unix timestamp from a given date and time.
5. strftime()
The strftime() function is used to format the date and time according to a specified format.
6. date_diff()
The date_diff() function is used to calculate the difference between two dates.
7. date_add()
The date_add() function is used to add a specified interval to a date.
8. date_sub()
The date_sub() function is used to subtract a specified interval from a date.
9. date_create()
The date_create() function is used to create a new DateTime object.
10. date_interval_create_from_date_string()
The date_interval_create_from_date_string() function is used to create a DateInterval object from a string that contains an interval specification.
