diff($d2); // get difference between two dates echo $interval->h; // convert days to hours and add hours from difference ?>