How do I calculate the difference between two dates in hours?
For example:
day1=2006-04-12 12:30:00 day2=2006-04-14 11:30:00
In thi
$day1 = "2006-04-12 12:30:00" $day1 = strtotime($day1); $day2 = "2006-04-14 11:30:00" $day2 = strtotime($day2); $diffHours = round(($day2 - $day1) / 3600);
I guess strtotime() function accept this date format.