VeloDB Cloud
SQL Manual
Functions
date-time-functions
seconds_diff

seconds_diff

Description

Syntax:

INT seconds_diff(DATETIME enddate, DATETIME startdate)

This function calculates the number of seconds between the startdate and the enddate.

Example

mysql> select seconds_diff('2020-12-25 22:00:00','2020-12-25 21:00:00');
+------------------------------------------------------------+
| seconds_diff('2020-12-25 22:00:00', '2020-12-25 21:00:00') |
+------------------------------------------------------------+
|                                                       3600 |
+------------------------------------------------------------+

Keywords

seconds_diff