PHP gets the system startup time length example code
- //Calculation of system startup time.
- $UPTIME = 32936982.68 ;
- $DAY = floor(($UPTIME / 86400)*1.0) ;
- $cal_day = $DAY * 86400 ;
- $cal_hour = $UPTIME - $cal_day ;
- $hour = floor(($cal_hour / 3600)*1.0) ;
- if ($hour < 10) {
- $hour = "0". $hour ;
- }
- $cal_tmp = $hour * 3600 ;
- ($cal_min / 60)*1.0) ;
- if ($min < 10) {
- $min = "0".$min ;
- }
- $cal_sec = $min * 60 ;
- $sec = floor(($cal_min - $cal_sec)*1.0) ;
- if ($min < 10) {
- $sec = "0".$sec ;
- }
- $ServerUptime = $DAY." day, ".$hour.":".$min." :".$sec ;
- echo result output: . $ServerUptime ;
- ?>
-
-
Result output: 381 days, 05:09:042
http://www.bkjia.com/PHPjc/486140.html
www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486140.htmlTechArticlephp example code to obtain the system startup time?php //System startup time calculation. $UPTIME = 32936982.68; $DAY = floor(($UPTIME / 86400)*1.0) ; $cal_day = $DAY * 86400 ; $cal_hour = $UP...