In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "how php converts timestamps into hours and minutes". In daily operation, I believe many people have doubts about how php converts timestamps into hours and minutes. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how php converts timestamps into hours and minutes". Next, please follow the editor to study!
Php converts timestamps into hours and minutes: 1, obtain UNIX system timestamps through time (); 2, convert timestamps into easy-to-read time by "date (" Y-m-d h:i:s ", $d);"
This article operating environment: Windows7 system, PHP7.1, Dell G3 computer.
How does php convert timestamps into hours and minutes?
Simple implementation of timestamp and concrete time conversion of PHP
Three built-in functions:
Time () / / get the UNIX system timestamp mktime (hour,minute,second,month,day,year) / / convert the specified time to a timestamp date (time format, timestamp) / / convert the timestamp into a time that is easy to read
Time-> date:
$now = time (); echo "timestamp is". $now;echo "creation date is". Date ("Y-m-d h:i:s", $now)
Output:
The timestamp is 1404610907. The creation date is 2014-07-06 09:41:47.
Mktime-> date:
$d=mktime (9, 41, 47, 7, 6, 2014); echo "timestamp is. $DX echo" creation date is. Date ("Y-m-d h:i:s", $d)
Output:
The timestamp is 1404610907. The creation date is 2014-07-06 09:41:47.
Note:
Generally, when registering or logging in, the time function is used by default to obtain the current timestamp. When there is a business that needs to specify a specific time, you can use the mktime function to convert the timestamp into a specific timestamp according to the specific time, while the date function can inversely convert the timestamp into a specific time that is easy to view.
At this point, the study on "how php converts timestamps into hours and minutes" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.