Fenhopi Posted November 22, 2010 Share Posted November 22, 2010 I have the time time now viewed as 17:11. The time $Start_Time is 17:00. The time $End_time is 18:00. Can I use this to check if time is in between starttime and endtime? Or do I have to convert it to other formats before it understand that I'm comparing it as times and not just numbers? if($Start_Time < $Now_time && End_Time > $Now_time){ } Link to comment https://forums.phpfreaks.com/topic/219472-how-can-i-compare-time-in-format-hhmm/ Share on other sites More sharing options...
PFMaBiSmAd Posted November 22, 2010 Share Posted November 22, 2010 If the format of every value is the same, HH:MM, with leading zeros when necessary to give that exact format, then yes, you can compare time this way. Link to comment https://forums.phpfreaks.com/topic/219472-how-can-i-compare-time-in-format-hhmm/#findComment-1137957 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.