# 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

```sql
SELECT TIME_TO_SEC('2009-02-13 23:31:30');

```

```output

+------------------------------------+
| TIME_TO_SEC('2009-02-13 23:31:30') |
+------------------------------------+
|                              84690 |
+------------------------------------+

```

***

Modified at: May 31, 2023

Source: [/cloud/reference/sql-reference/date-and-time-functions/time-to-sec/](https://docs.singlestore.com/cloud/reference/sql-reference/date-and-time-functions/time-to-sec/)

(An index of the documentation is available at /llms.txt)
