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. Link to comment https://forums.phpfreaks.com/topic/45996-solved-strtotime/ 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. Link to comment https://forums.phpfreaks.com/topic/45996-solved-strtotime/#findComment-223506 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"; } ?> Link to comment https://forums.phpfreaks.com/topic/45996-solved-strtotime/#findComment-223513 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.