Show datediff as seconds, milliseconds

后端 未结 3 1067
面向向阳花
面向向阳花 2021-01-01 15:46

I\'m trying to calculate the difference between two datetime values.

I tried datediff(s, begin,end) and datediff(ms, begin,end) however I w

3条回答
  •  悲&欢浪女
    2021-01-01 15:54

    DATEDIFF takes only two arguments in MySQL. This works for me:

    TIMESTAMPDIFF(SECOND, NOW(), '2019-09-09 18:52:00')
    

提交回复
热议问题