> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# time_to_sec

> Converts a time value into the number of seconds.

Converts a time value into the number of seconds. The formula used for the conversion is as follows:

Hour x 3600 + Minute x 60 + Second

## Syntax

```Haskell theme={null}
BIGINT time_to_sec(TIME time)
```

## Parameters

`time`: It must be of the TIME type.

## Return value

Returns a value of the BIGINT type. If the input is invalid, NULL is returned.

## Examples

```plain text theme={null}
select time_to_sec('12:13:14');
+-----------------------------+
| time_to_sec('12:13:14')     |
+-----------------------------+
|                        43994|
+-----------------------------+
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.