fork(3) download
  1. <?php
  2.  
  3. $start=date_create("2016-05-16 23:04:08");
  4. $end=date_create("2016-05-17 8:23:14");
  5. $diff=date_diff($start,$end);
  6. echo $diff->format("%H:%I:%S");
  7. echo "\n";
  8.  
  9. $diff_s = $end->getTimestamp() - $start->getTimestamp();
  10. $diff_h = $diff_s/3600;
  11. echo round($diff_h, 2);
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
09:19:06
9.32