In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, I would like to share with you the relevant knowledge about how to judge the current point of php. The content is detailed and the logic is clear. I believe most people still know too much about this, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.
Php method to determine the current time: 1, use the time () or strtotime () function to get the timestamp representing the current time; 2, use the "date (" H:i:s ", timestamp)" statement to format the timestamp, convert it to "hours: minutes: seconds" format and output.
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
Php judges what time it is.
1. Get the timestamp that represents the current time
Method 1: use the time () function
The time () function returns the number of seconds in the current time since the Unix era (January 1 1970 00:00:00 GMT).
Syntax:
Time ()
Method 2:strtotime () function
The strtotime () function parses the date-time description of any string into an Unix timestamp (the number of seconds since January 1 1970 00:00:00 GMT).
Syntax:
Strtotime ("now")
2. Use the date () function to format the timestamp
Date ("H:i:s", timestamp)
Complete code:
These are all the contents of the article "how to judge what time it is now by php". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
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.