I'm trying to get the time difference between the current date and another date in php but i'm getting wrong results. Her's my code so far:
function hoursDifference($date)
{
return round((time()- strtotime($date))/3600);
}
The input date is: 2016-03-20 03:55:51 but the current time is using the 24 hours format, so the H is 15 instead of 3 and the function returns a correct 12 hour time difference. How can I fix this?