MySql difference between two timestamps in days?

前端 未结 7 1185
既然无缘
既然无缘 2020-11-30 01:14

How can I get the difference between two timestamps in days? Should I be using a datetime column for this?


I switched my column to datetime. Simple subtraction doesn\'t
7条回答
  •  清歌不尽
    2020-11-30 01:44

    If you want to return in full TIMESTAMP format than try it: -

     SELECT TIMEDIFF(`call_end_time`, `call_start_time`) as diff from tablename;
    

    return like

         diff
         - - -
        00:05:15
    

提交回复
热议问题