note 68811 added to function.time

From: Date: Fri, 11 Aug 2006 15:15:18 +0000
Subject: note 68811 added to function.time
Groups: php.notes 
Request: Send a blank email to php-notes+get-115797@lists.php.net to get a copy of this message
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. ---- Server IP: 216.194.113.175 Probable Submitter: 71.40.149.6 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.time.php Edit -- https://master.php.net/note/edit/68811 Del: integrated -- https://master.php.net/note/delete/68811/integrated Del: useless -- https://master.php.net/note/delete/68811/useless Del: bad code -- https://master.php.net/note/delete/68811/bad+code Del: spam -- https://master.php.net/note/delete/68811/spam Del: non-english -- https://master.php.net/note/delete/68811/non-english Del: in docs -- https://master.php.net/note/delete/68811/in+docs Del: other reasons-- https://master.php.net/note/delete/68811 Reject -- https://master.php.net/note/reject/68811 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#115797) next »