Syntax
TO_SECONDS(expr)
Purpose
You can call this function to return the number of seconds from the year 0 to the date or datetime expression expr. If expr is NULL, NULL is returned.
Examples
obclient> SELECT TO_SECONDS(950501);
+--------------------+
TO_SECONDS(950501)
+--------------------+
62966505600
+--------------------+
1 row in set (0.00 sec)
obclient> SELECT TO_SECONDS('2021-07-15');
+--------------------------+
TO_SECONDS('2021-07-15')
+--------------------------+
63793526400
+--------------------------+
1 row in set (0.00 sec)