PHP检查时间戳大于24小时以后
发布时间:2020-12-13 17:29:39 所属栏目:PHP教程 来源:网络整理
导读:我有软件需要确定截止日期时间是否大于24小时以后.这是我必须测试的代码. $date = strtotime("2013-07-13") + strtotime("05:30:00"); if($date time() + 86400) { echo 'yes'; } else { echo 'no'; } 我目前的日期和时间是2013-07-13上午2点.你可以看到它只
我有软件需要确定截止日期时间是否大于24小时以后.这是我必须测试的代码.
$date = strtotime("2013-07-13") + strtotime("05:30:00"); if($date > time() + 86400) { echo 'yes'; } else { echo 'no'; } 我目前的日期和时间是2013-07-13上午2点.你可以看到它只有3个小时的路程. $date = strtotime("2013-07-13") + strtotime("05:30:00"); 应该 $date = strtotime("2013-07-13 05:30:00"); See difference in this CodePad (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |