mysql timediff to hours

前端 未结 10 1767
我寻月下人不归
我寻月下人不归 2020-12-13 08:47

I\'m Trying to get the timediff from my table and convert it to hours (it\'s for an hourly billed service)

SELECT TIME_TO_SEC(TIMEDIFF(endDate,startDa

10条回答
  •  遥遥无期
    2020-12-13 09:28

    for getting Diffrence in Hour :

    Hour(TIMEDIFF(date1,date2)) as Hour1
    

    for getting Diffrence in Minute :

    Minute(TIMEDIFF(date1,date2)) as Minute1
    

    for getting Diffrence in Second :

    Second(TIMEDIFF(date1,date2)) as Second1
    

提交回复
热议问题