Php implementation display website running time-second conversion Year Month Day hour minute second _ PHP Tutorial

Source: Internet
Author: User
Php enables the display of the website running time-seconds to convert the year, month, day, hour, minute, and second .? Php sets the time zone date_default_timezone_set (AsiaShanghai); *** second to time, format Year Month Day hour minute second *** @ authorwangyupeng129@126.com * @ paramint $ time * @ returnarr
 0, "days" => 0, "hours" => 0, "minutes" => 0, "seconds" => 0,); if ($ time> = 31556926) {$ value ["years"] = floor ($ time/31556926); $ time = ($ time % 31556926);} if ($ time> = 86400) {$ value ["days"] = floor ($ time/86400); $ time = ($ time % 86400);} if ($ time> = 3600) {$ value ["hours"] = floor ($ time/3600); $ time = ($ time % 3600);} if ($ time> = 60) {$ value ["minutes"] = floor ($ time/60); $ time = ($ time % 60);} $ value ["seconds"] = floor ($ Time); return (array) $ value;} else {return (bool) FALSE ;}} // The site creation time $ site_create_time = strtotime ('2017-05-22 00:00:00 '); $ time = time ()-$ site_create_time; $ uptime = Sec2Time ($ time);?> Run on this site:
 Year
 Days
 Hours
 Minute
 Seconds

Http://www.bkjia.com/PHPjc/771955.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/771955.htmlTechArticle? Php // Set the time zone date_default_timezone_set ('Asia/Shanghai');/*** second conversion time, format Year Month Day minute second ** @ author wangyupeng129@126.com * @ param int $ time * @ return arr...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.