Outdated Version

You are viewing an older version of this section. View current production version.

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 |
+------------------------------------+