Recently, I have used PHP more frequently for time processing. Now I will sort out the knowledge points. The
time()
time() function returns the Unix timestamp of the current time.
$t=time(); echo($t . "<br />");
It feels useless. At this time, we need to use the date function to convert the object into the date we need.
date(format,,timestamp)
The date function format is very flexible and can be used in various ways, which is enough to meet various situations you encounter during the development process.
format: required, specifies the output format of the timestamp;
timestamp: optional, specifies the time
date_default_timezone_set(PRC); /*Adjust the time to Beijing time, php5 default is GMT*/
To be continued,. . .
The above has introduced the basic analysis of time date strtotime in PHP, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.