In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Editor to share with you the PHP date-time function example analysis, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to understand it!
1. Date_default_timezone_set ("PRC"); / / set the default time zone
$t = time ()
Echo $t
$d = date ("M / d / Y H:i:s", $t); / / the data function formats the timestamp into a more readable date and time.
Echo $d
Displayed as: 1464678649 15:10:49 on 31 May 2016
2. The Microtime (true) function returns the current Unix timestamp and microseconds.
$T1 = microtime (true)
/ /... Execute the code.
$T2 = microtime (true)
Echo 'time-consuming' .round ($t _ 2murf _ t _ 1pr _ 3). Seconds'
3. The strtotime () function parses the date-time description of any English text into a Unix timestamp.
Echo date ('Y-m-d now') + 8' 60')
Result: 2013-04-05 03:15:02
/ / get the timestamp of the current time!
4. The mktime () function returns the Unix timestamp of a date.
Echo date ("M-d-Y", mktime (0,0,0,12,32))
Displayed as: Jan-01-1998
The above is all the contents of the article "sample Analysis of PHP date-time function". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow 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.