donglipi4495 2011-02-25 01:43
浏览 5
已采纳

如何检测PHP / MySQL中是否已经过了一定的时间?

I have a time stamp in a MySQL database that looks like this:

2011-02-23 20:39:49

How can I detect if a certain amount of time has passed since the creation of that timestamp. In other words if the timestamp was created on February 23, 2010 at 8:39:43 P.M. how can I detect if exactly 10 days (240 hours) have passed since the creation of this timestamp? How to do this in PHP?

  • 写回答

5条回答 默认 最新

  • douzhan6474 2011-02-25 01:49
    关注
    SELECT *
    FROM table
    WHERE timestampcol < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 10 DAY)
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?