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...