fork download
  1. <?php
  2.  
  3. $timeA = '01:11:01';
  4. $timeB = '02:22:00';
  5.  
  6. $fechaA = "1970-01-01 $timeA";
  7. $fechaB = "1970-01-01 $timeB";
  8.  
  9.  
  10. # Formato HH:MM:SS
  11. $diff = gmdate("H:i:s", strtotime($fechaB)-strtotime($fechaA));
  12. print("-->".$diff."\n");
  13.  
Success #stdin #stdout 0.01s 82624KB
stdin
Standard input is empty
stdout
-->01:10:59