Skip to main content
Version: V1.0.0

TO_SECONDS

Syntax

TO_SECONDS(expr)

Description

Returns the number of seconds since the beginning of year 0 for the expr expression. If expr is NULL, it returns NULL.

Examples

SELECT TO_SECONDS(950501);
+--------------------+
| TO_SECONDS(950501) |
+--------------------+
| 62966505600 |
+--------------------+
1 row in set (0.102 sec)

SELECT TO_SECONDS('2021-07-15');
+--------------------------+
| TO_SECONDS('2021-07-15') |
+--------------------------+
| 63793526400 |
+--------------------------+
1 row in set (0.001 sec)