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){ } Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.