---
title: time_from_millis function
description: Learn the syntax of the time\_from\_millis function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/gcp/en/sql/language-manual/functions/time_from_millis
---

# `time_from_millis` function

**Applies to:** ![check marked yes](https://docs.databricks.com/gcp/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/gcp/en/images/icons/check.png) Databricks Runtime 18 LTS and above

> [!NOTE]
>
> Databricks Runtime 18 is newer than Databricks Runtime 18.0, 18.1, and 18.2. Features that would previously have shipped as a later numbered version now ship as dated updates to Databricks Runtime 18 instead. For details, see [About unified release notes](https://docs.databricks.com/gcp/en/release-notes/runtime/18.md#unified-format).

Creates a [TIME](https://docs.databricks.com/gcp/en/sql/language-manual/data-types/time-type.md) value from the number of milliseconds since midnight.

## Syntax

```
time_from_millis(expr)
```

## Arguments

* `expr`: An integral numeric expression representing milliseconds since midnight (0 to 86399999).

## Returns

A [TIME](https://docs.databricks.com/gcp/en/sql/language-manual/data-types/time-type.md).

## Examples

```sql
> SELECT time_from_millis(52200500);
  14:30:00.500000

> SELECT time_from_millis(0);
  00:00:00
```

## Related functions

* [`time_from_seconds` function](https://docs.databricks.com/gcp/en/sql/language-manual/functions/time_from_seconds.md)
* [`time_from_micros` function](https://docs.databricks.com/gcp/en/sql/language-manual/functions/time_from_micros.md)
* [`time_to_millis` function](https://docs.databricks.com/gcp/en/sql/language-manual/functions/time_to_millis.md)
* [`TIME` type](https://docs.databricks.com/gcp/en/sql/language-manual/data-types/time-type.md)
