Question: how to calculate hours between two dates in php?
Answer: Method 1: Using strtotime() function $timestamp1 = strtotime ( $date1 ); $timestamp2 = strtotime ( $date2 ); echo "Difference between two dates is " . $hour = abs ( $timestamp2 - $timestamp1 )/(60*60) .