Click here to Skip to main content
15,921,279 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys... i just want to ask why is it that my strtotime comparing is not working? or not comparing my 2 dates? here is my code
PHP
$newdate= strtotime ( '+1 minutes' , strtotime ($_COOKIE['adstime'] ));
$dateNow= strtotime($_POST["time"]);
   if($dateNow > $newdate){
        return "yes its greater";
    }else{
         return "no - " . $newdate . " - " . ($dateNow > $newdate) . " - " .$dateNow ;		   

    }


As you can see im just comparing the $newdate and the $dateNow and it return false
so i tried to echo the output using this code
return "no - " . $newdate . " - " . ($dateNow > $newdate) . " - " .$dateNow ;


But the output is just
no - 1328770759 -  - 1328741009

its not executing the date comparing... please help and any idea guys...
Posted

1 solution

That looks correct to me. PHP outputs a boolean true as "1" and a boolean false as "".
 
Share this answer
 
Comments
Madzmar25 9-Feb-12 4:27am    
im not sure... maybe i just overlook something... now its working fine... hmm... but still thanks for taking your time to look at this...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900