0

I have a table that I draw information from out my DB. I want to calculate the difference between the two times in the DB

<?php echo abs($rows['systime']-$rows['ver_time']); ?>

<?php echo round($rows['systime']-$rows['ver_time']); ?>

I get no result on the above

I basically just need the minutes between the two times

Time format is HH:MM:SS

eTrack
  • 7
  • 3

1 Answers1

0

I found this to work for me pulling the info from the DB and giving difference

<?php
      $datetime1 = new DateTime("$rows[systime]");
      $datetime2 = new DateTime("$rows[ver_time]");
      $interval = $datetime1->diff($datetime2);
      echo $interval->format(' %H:%i:%s');
 ?>
eTrack
  • 7
  • 3