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

> 将TIME时间值转换为秒数。

将 `time` 时间值转换为秒数，转换公式为:

`${小时}\times{3600} + {分钟}\times{60} + 秒$`

## 语法

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

## 参数说明

`time`：支持的数据类型为 TIME。

## 返回值说明

返回 BIGINT 类型的值。如果输入值格式非法，返回 NULL。

## 示例

```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.