Mysql difference between two timestamps

Time difference

You could use the TIMEDIFF()

Example:
SELECT TIMEDIFF('2018-02-13 01:01:00', '2018-02-13 01:00:00')


Seconds Difference

You could use the TIME_TO_SEC()

Example:
SELECT TIME_TO_SEC(TIMEDIFF('2018-02-13 01:01:00', '2018-02-13 01:00:00')) diff;

Post a Comment

0 Comments