Comparing timestamp to current time from database

前端 未结 4 1506
感情败类
感情败类 2020-12-29 03:50

I need to test current time against a datetime from database, if it has been 30 mins then execute code, if not then dont. This is where I am at and I am stuck:



        
4条回答
  •  醉酒成梦
    2020-12-29 04:26

    do it all in sql statement

    SELECT id FROM `dqCache` WHERE `time`

    This will return everything from your table where the time column is before 30 minutes before now.

提交回复
热议问题