If you store the time at the Seconds level of granularity, you can use the fact that there are 3600 seconds per hour, and find the difference, do the division, and get your result.

Good luck.