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

> The SEC_TO_TIME function converts a value in seconds into a TIME type, returning the result in the format HH:MM:SS.

## Description

The SEC\_TO\_TIME function converts a value in seconds into a TIME type, returning the result in the format HH:MM:SS.
The input seconds represent the time elapsed since the start of a day (00:00:00).

## Syntax

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

## Parameters

`sec`: It must be of the INT type.

## Return value

Returns a TIME value in the format HH:MM:SS, representing the time calculated from the start of a day (00:00:00).
If sec is NULL, the function returns NULL.

## Examples

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