$startdate = $info_x['end_time']; $enddate = date("Y-m-d H:i:s"); $date = floor((strtotime($enddate)-strtotime($startdate))/86400); //天数 $hour = floor((strtotime($enddate)-strtotime($startdate))%86400/3600); //小时 $minute = floor((strtotime($enddate)-strtotime($startdate))%86400/60); //分钟 $second = floor((strtotime($enddate)-strtotime($startdate))%86400%60); //秒 $cha1 = (($date*86400) + ($hour*3600) + ($minute*60)) + $second; if($info_x['status'] == 0){$j = ($info_x['yield'] * $cha1 / 3600);}else{$j=0;} $data['runtime'] = $info_x['runtime'] + $cha1; //已运行时间 $data['end_time'] = date('Y-m-d H:i:s'); //结算时间 $data['profit'] = $info_x['profit'] + $j; //当前收益 /********************************/ echo '实际产量/每小时:0.01527778<br><br>'; echo '实际时间/分钟'.($minute).'<br><br>'; echo '实际时间/小时'.($minute/60).'<br><br>'; echo '结算'.$j.'<br><br><br>'; echo '运行时间/小时:'.floor($data['runtime']/3600*100)/100; echo '<br><br>';die(); //TEST_TEST /********************************/