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 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 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
Archived
This topic is now archived and is closed to further replies.