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

# FORMAT_TIMESTAMP

> Formats a timestamp as a string.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

NULL value or NULL format yields NULL. Invalid format/value conversion can raise an error.

## Syntax

### Scalar

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
format_timestamp(value, format)
```

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | TIMESTAMP | Yes | Temporal value to format. |
| format | STRING | Yes | Java/MySQL-compatible formatting pattern. |

## Returns

* Type: STRING
* NULL behavior: NULL value or NULL format yields NULL. Invalid format/value conversion can raise an error.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Exact result | Yes |

## Usage notes

* E6 argument order is (value, format), not BigQuery's (format, value).
* The format can be a constant or a column with a different format for each row.

## Examples

### Basic example

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT format_timestamp(TIMESTAMP '2024-03-15 10:30:45','yyyy-MM-dd') AS result;
```

| result |
| - |
| 2024-03-15 |

### Format a timestamp with time fields

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT format_timestamp(TIMESTAMP '2024-03-15 10:30:45', 'dd/MM/yyyy HH:mm') AS formatted;
```

| formatted |
| - |
| 15/03/2024 10:30 |

## Limitations

* Calendar calculations use the timestamp’s stored UTC time. They do not adjust it to the timestamp’s named time zone.


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