strtotime比较返回错误 [英] strtotime comparing returns error
本文介绍了strtotime比较返回错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好...我只想问为什么我的strtotime比较不起作用?还是不比较我的两个日期?这是我的代码
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
$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 ;
}
如您所见,即时通讯仅比较$ newdate和$ dateNow并返回false
所以我尝试使用此代码回显输出
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...
推荐答案
newdate = strtotime(' + 1分钟",strtotime(
newdate= strtotime ( '+1 minutes' , strtotime (
_COOKIE [ adstime'])));
_COOKIE['adstime'] ));
dateNow = strtotime(
dateNow= strtotime(
这篇关于strtotime比较返回错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文