johnsmith153 Posted April 16, 2011 Share Posted April 16, 2011 E.g. 18:00 - 22:30 $a = "18:00"; $b = "22:30"; this would return 4.5 (hours) 22:00 - 01:00 would return 3 hours Quote Link to comment https://forums.phpfreaks.com/topic/233876-simple-way-to-convert-times-into-number-of-hours/ Share on other sites More sharing options...
requinix Posted April 16, 2011 Share Posted April 16, 2011 Figure out the number of minutes for each: 60*hour + minute. Then subtract. (If you end up with something Quote Link to comment https://forums.phpfreaks.com/topic/233876-simple-way-to-convert-times-into-number-of-hours/#findComment-1202249 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.