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

# DATE_FORMAT

> Formats a date or timestamp as a string.

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

**Aliases:** [`format_date`](/query/sql/functions/date-time/format_date)

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

## Syntax

### Date format form (scalar)

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

* DATE\_FORMAT uses the configured SQL dialect’s date-formatting rules.

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | DATE or 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.
* DATE\_FORMAT takes (value, format) and follows the same NULL and format rules. The UTC-time limitation below also applies.
* DATE\_FORMAT takes (value, format) in both the Databricks and E6 SQL dialects. Both forms accept the same Java-style patterns and return STRING.

## Examples

### Alias calling form: DATE\_FORMAT

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT date_format(DATE '2024-03-15','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 date_format(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.