stockdalep Posted April 7, 2007 Share Posted April 7, 2007 Hi I have a site that requires it users to select a delivery time. But I need to ensure that if the time has gone past 10 am they cannot select this day. I cannot figure out the question marks. if(strtotime("now") > ???????){ echo("no"); } else { echo("yes"); Thanks for any help. Quote Link to comment Share on other sites More sharing options...
HaLo2FrEeEk Posted April 7, 2007 Share Posted April 7, 2007 WEll, will this be 10 am in your timezone, or their timezone? Either way, you wouldn't need to use strtotime here, just get the hour in your timezone and check if it is greater than 10. Quote Link to comment Share on other sites More sharing options...
brissy_matty Posted April 7, 2007 Share Posted April 7, 2007 This may work for you - very basic version. <? // Selects Hours & minutes in 24hour format as a combined number $timenow=date("Hi"); if($timenow>1000) { //If the time is more then 1000 echo "yes"; } else { //If the time is less then 1000 echo "no"; } ?> 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.