---
title: timestamp function
description: Learn the syntax of the timestamp function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/timestamp
---

# `timestamp` function

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

Casts `expr` to TIMESTAMP. This function is a synonym for `CAST(expr AS TIMESTAMP)`. For details see [`cast` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/cast.md).

## Syntax

```
timestamp(expr)
```

## Arguments

* `expr`: Any expression that can be cast to TIMESTAMP.

## Returns

A TIMESTAMP.

## Examples

```sql
> SELECT timestamp('2020-04-30 12:25:13.45');
 2020-04-30 12:25:13.45
> SELECT timestamp(date'2020-04-30');
 2020-04-30 00:00:00
> SELECT timestamp(123);
 1969-12-31 16:02:03
```

## Related functions

* [`cast` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/cast.md)
