Syntax

TIME_TO_SEC(time)

Description

Returns the time argument, converted to seconds.

Starting with MariaDB 5.3, the value returned by TIME_TO_SEC is of type DOUBLE. In previous versions of MariaDB (and MySQL) the type was INT. See Microseconds in MariaDB for more information on the feature that introduced this change.

Examples

SELECT TIME_TO_SEC('22:23:00');
+-------------------------+
| TIME_TO_SEC('22:23:00') |
+-------------------------+
|                   80580 |
+-------------------------+
SELECT TIME_TO_SEC('00:39:38');
+-------------------------+
| TIME_TO_SEC('00:39:38') |
+-------------------------+
|                    2378 |
+-------------------------+

Comments

Comments loading...