note 68811 deleted from function.time by bobby

From: Date: Wed, 18 Oct 2006 15:09:13 +0000
Subject: note 68811 deleted from function.time by bobby
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-118695@lists.php.net to get a copy of this message
Note Submitter: TecBrat ---- I needed a conditional, if 'now' is 11:00am or earlier. Here's what I came up with: <? $t=time(); $h=date("H",$t)+1; //server time is one hour behind my local time. $m=date("i",$t)+($h*60); if ($m<660){print $m;}else{echo("Too Late");} ?> let's change as follows <? $deadline=11; //(whole hours only, could be a form or databse entry) ... $deadline=$deadline*60; if ($m<$deadline){print $m;}else{echo("Too Late");} ?> I am sure you can use your imagination to expand on the idea.

« previous php.notes (#118695) next »