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 Quote Link to comment 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 ">". Quote Link to comment 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.