Pilli Posted April 13, 2006 Share Posted April 13, 2006 I have a form where I put in start time and end timeeg$start= 11:00;$end=16:30;What i would like to do is get the total number of hours eg. total hours between 11:00 and 16:30I tried $difference= $end-$start;echo "$difference";but I get the answer 5 when it should be 5:30I think I should be using the date function but not sure how to subtract two times. A point in the right direction would be most appreciated. Link to comment https://forums.phpfreaks.com/topic/7279-time-calculation/ Share on other sites More sharing options...
.josh Posted April 13, 2006 Share Posted April 13, 2006 [a href=\"http://us2.php.net/manual/en/function.time.php\" target=\"_blank\"]http://us2.php.net/manual/en/function.time.php[/a] Link to comment https://forums.phpfreaks.com/topic/7279-time-calculation/#findComment-26475 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.