Mr Chris Posted August 12, 2010 Share Posted August 12, 2010 Hello, Im trying to work out some code. On my site between Thursday 12th July and Sunday 15th July between the hours of 22:00 and 23:00 I want to display some code. I've done this so far, but am having trouble. Anyone please help? $the_date = date("H:i:s"); $timesep = explode(":",$the_date); // $hour = $timesep[0]; if (($the_date > 2010-08-12 && < 2010-08-15) && ($hour >= 22) && ($hour <= 23)) { //Code } Quote Link to comment Share on other sites More sharing options...
marcus Posted August 12, 2010 Share Posted August 12, 2010 <?php $date = date("m-d-y"); // 08-12-10 $dates = array('08-12-10','08-13-10','08-14-10','08-15-10'); $hm = date("H:i"); // 15:47 list($hour,$minute) = explode(":",$hm); if(in_array($date,$dates) && $hour == '22' && in_array($minute,range(0,59))){ // code } ?> 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.