Beauford Posted February 8, 2010 Share Posted February 8, 2010 How can I find if the current time is between a predetermined time. ex: How would I find if 4:52a is > midnight and < 6am I need 4 of these checks, one every 6 hours: midnight to 6a, 6a to 12p, 12p to 6pm, 6pm to midnight. Thanks Link to comment https://forums.phpfreaks.com/topic/191311-finding-time/ Share on other sites More sharing options...
btherl Posted February 8, 2010 Share Posted February 8, 2010 If you convert all your time values into "seconds since epoch", which is the default return value of time(), and also comes out of strtotime(), then you can compare everything using "<" and ">". Link to comment https://forums.phpfreaks.com/topic/191311-finding-time/#findComment-1008674 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.