"); The $t object here outputs a number. This number represents the total number of seconds since 1970-01-01. 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 $t object here outputs a number. This number represents the total number of seconds since 1970-01-01. 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">
Home >Backend Development >PHP Tutorial >PHP about time date strtotime basic analysis
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 />");The $t object here outputs a number. This number represents the total number of seconds since 1970-01-01.
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.