zeze Posted January 13, 2013 Share Posted January 13, 2013 How to count time when it goes over the midniht ? For example lets say start time is 15:00 and end time is 01:00 then how to calculate time between there. I know one way is to add date to these times but is there a way around it ? I don't want to add 2 extra fields and force user to select dates. Link to comment https://forums.phpfreaks.com/topic/273102-how-to-count-hours-when-time-goes-over-0000/ Share on other sites More sharing options...
Jessica Posted January 13, 2013 Share Posted January 13, 2013 Without a date, how do you know if its 1 am the next day or 1 am three days later? Link to comment https://forums.phpfreaks.com/topic/273102-how-to-count-hours-when-time-goes-over-0000/#findComment-1405381 Share on other sites More sharing options...
Barand Posted January 13, 2013 Share Posted January 13, 2013 if second time less than first time then add 24 hours before subtracting Link to comment https://forums.phpfreaks.com/topic/273102-how-to-count-hours-when-time-goes-over-0000/#findComment-1405382 Share on other sites More sharing options...
zeze Posted January 14, 2013 Author Share Posted January 14, 2013 Barand solved it! Thanks ! Link to comment https://forums.phpfreaks.com/topic/273102-how-to-count-hours-when-time-goes-over-0000/#findComment-1405422 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.