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

# sec_to_time

> 将以秒为单位的值转换为 TIME 类型，返回格式为 HH:MM:SS。

## 功能

SEC\_TO\_TIME 函数将一个以秒为单位的值转换为 TIME 类型，返回格式为 HH:MM:SS。输入的秒数表示从一天的起点时间（00:00:00）开始计算的时间。

## 语法

```Haskell theme={null}
TIME sec_to_time(BIGINT sec)
```

## 参数说明

`sec`：必填，输入的秒数，表示从一天起点时间（00:00:00）开始计算的秒数，支持正整数或负整数类型。

## 返回值说明

必填，输入的秒数，表示从一天起点时间（00:00:00）开始计算的秒数，支持正整数或负整数类型。
如果输入的 sec 为 NULL，函数返回 NULL。

## 示例

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


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