Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
Do you have a db at hand?
They excel at that work. You could just send a query that returns 1 or 0 if the difference between now() and a date is less than 2 minutes
PHP Code:
<?php $datetime = "Jun 25 15:40:54"; $tstamp = strtotime($datetime); $fullDate=strftime('%Y-%m-%d %H:%M:%S',$comp); //output "2010-06-25 15:40:54" $query="select passed=case when TIMESTAMPDIFF(minute, '$fullDate', now())<=2 then 0 else 1 end;" $res=mysql_query($query); while($o=mysql_fetch_object($res)){ if($o->passed==1){ //2 minutes have passed } }
__________________
Only a biker knows why a dog sticks his head out the window.
Last edited by tripy; 06-25-2010 at 04:41 PM..
|