jcadima
2/20/2017 - 6:11 PM

Difference between 2 times

Difference between 2 times

http://stackoverflow.com/questions/13928021/getting-time-difference-between-two-times-in-php


<?php

$time1 = new DateTime('01:15:59');
$time2 = new DateTime('02:03:17');
$difference = $time1->diff($time2);
echo "RANGE OR DIFFERENCE: " . $difference->format('%h:%i:%s') . "\n";