fork download
  1. <?php
  2.  
  3. $d1 = new DateTime('2018-04-23 11:20:33');
  4. $d2 = new DateTime('2018-04-23 08:01:00');
  5.  
  6. $atraso = $d1->diff($d2);
  7.  
  8. echo $atraso->format('%H:%i:%s'), PHP_EOL;
Success #stdin #stdout 0.02s 23992KB
stdin
Standard input is empty
stdout
03:19:33