PHP日期比较 [英] PHP date comparison
本文介绍了PHP日期比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何检查2008-02-16 12:59:57格式的日期是否少于24小时前?
How would I check if a date in the format "2008-02-16 12:59:57" is less than 24 hours ago?
推荐答案
if (strtotime("2008-02-16 12:59:57") >= time() - 24 * 60 * 60)
{ /*LESS*/ }
这篇关于PHP日期比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文