views:

147

answers:

2

Hi,

How can i find the date difference in hours using php and mysql both.

Thanks
Avinash

A: 

Use TIMEDIFF() then take the part before the first colon to get the hours.

Max Shawabkeh
A: 

For MySQL there are a number of DATE/TIME functions, DATEDIFF(), SUBDATE(), SUBTIME()

Phill Pafford