fork(10) download
  1. <?php
  2.  
  3. $data1 = '2018-01-09 16:14:01';
  4. $data2 = '2018-01-09 17:30:04';
  5.  
  6. $unix_data1 = strtotime($data1);
  7. $unix_data2 = strtotime($data2);
  8.  
  9.  
  10. $nHoras = ($unix_data2 - $unix_data1) / (60 * 60);
  11. $nMinutos = (($unix_data2 - $unix_data1) % (60 * 60)) / 60;
  12.  
  13. printf('%02d:%02d', $nHoras, $nMinutos);
  14.  
Success #stdin #stdout 0.02s 23936KB
stdin
Standard input is empty
stdout
01:16