Watch the 7.3 Webinar On-Demand
This new release brings updates to Universal Storage, query
optimization, and usability that you won’t want to miss.
Returns the number of seconds counting from year 0 to the input datetime.
TO_SECONDS ( dateobj )
Integer
select to_seconds('0000-01-01');
+--------------------------+
| to_seconds('0000-01-01') |
+--------------------------+
| 86400 |
+--------------------------+
select to_seconds('2016-03-23 08:17:01');
+-----------------------------------+
| to_seconds('2016-03-23 08:17:01') |
+-----------------------------------+
| 63625940221 |
+-----------------------------------+