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.

TIME_TO_SEC

Returns the number of seconds from midnight.

Syntax

TIME_TO_SEC ( dateobj )

Arguments

  • dateobj: a valid date, datetime, time, or parsable date string.

Return Type

Integer

Examples

select time_to_sec('2009-02-13 23:31:30');
+------------------------------------+
| time_to_sec('2009-02-13 23:31:30') |
+------------------------------------+
|                              84690 |
+------------------------------------+