Calculating time difference between 2 dates in minutes

前端 未结 4 2011
无人共我
无人共我 2020-12-03 00:09

I have a field of time Timestamp in my MySQL database which is mapped to a DATE datatype in my bean. Now I want a query by which I can fetch all records in the

4条回答
  •  不思量自难忘°
    2020-12-03 01:05

    I am using below code for today and database date.

    TIMESTAMPDIFF(MINUTE,T.runTime,NOW()) > 20

    According to the documentation, the first argument can be any of the following:

    MICROSECOND
    SECOND
    MINUTE
    HOUR
    DAY
    WEEK
    MONTH
    QUARTER
    YEAR
    

提交回复
热议问题