How to get the difference between two dates rounded to hours

前端 未结 8 1312

I\'ll illustrate what I would like to get in the following example:

\'2010-09-01 03:00:00\' - \'2010-09-01 00:10:00\'

Using TIMEDIFF(

8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-04 21:48

    MySQL get the number of hours between timestamps:

    select timestampdiff(second,'2010-09-01 00:10:00', '2010-09-01 03:00:00')/3600;
    

提交回复
热议问题