Hi all,
I have read a few posts relating to find the amount of time between 2 dates and it looks like I am doing it right but the result is odd.
My dates are stored in MySQL datetime fields.
if if echo $row_ConfTracker['TimeRecieved I get "2015-04-23 08:00"
and for $row_ConfTracker['ConvertedDate'] I get "2015-04-23 18:00"
When I run the code bwlow the result is: 0 days 2 hours 19 minutes.
Can anyoe see why or where I am going wrong.
$StartDate = new DateTime($row_ConfTracker['TimeRecieved']);
$EndDate = new DateTime($row_ConfTracker['ConvertedDate']);
// The diff-methods returns a new DateInterval-object...
$diff = $EndDate->diff($StartDate);
// Call the format method on the DateInterval-object
$TimeDiff = $diff->format('%d days %h hours %i minutes');
echo $TimeDiff;
Many thanks in advance for any help you can provide.
Blackbox