# strftime — Haybarn WASM 1.5.5-rc3

Converts a `date` to a string according to the format string.

- Reference: /products/haybarn/functions/releases/haybarn-1.5.5-rc3/strftime/
- JSON: /products/haybarn/functions/api/v1/haybarn-1.5.5-rc3/functions/strftime.json
- Snapshot ID: haybarn-1.5.5-rc3
- Engine: haybarn v1.5.6-dev149
- Source ID: 105edd31b5
- Binary SHA-256: 426638bc374fcc542fea93b251f885bfb7d221c68fcc0a5a81cc565d7e6ca180
- Captured: 2026-09-06T00:23:30.515Z
- Source: https://www.npmjs.com/package/@haybarn/haybarn-wasm/v/1.5.5-rc3
- Loaded extensions: core_functions, icu, json, parquet

## Interpretation

- Choose a snapshot matching the target engine and build. The default is captured from the published Haybarn WASM package used by the browser playground. Historical native snapshots are also available.
- Availability is an observation in the recorded build and extension profile, not a guarantee of support in every installation or in WASM.
- Types and descriptions are declarations from duckdb_functions(). Binding can specialize result types. Null means not supplied by the catalog; do not invent defaults, optionality, argument mode, or table output columns.
- Raw parameter arrays preserve catalog order for scalar/aggregate/macro functions. Raw table arguments are alphabetical. Use callingConvention for engine-confirmed positional order and named arguments; null modes are unrecorded. Named does not mean optional. Macro defaults and special named variadic behavior are not supplied by duckdb_functions().
- Catalog examples are source material and may require data or extensions. runnableExamples contains separately verified SQL for the pinned WASM package; sample-data adaptations and guide examples are labeled separately.
- Guide annotations and recipes are separate editorial content. The browser runner always uses Haybarn WASM 1.5.5-rc3, independently of the documentation snapshot.
- All URLs beginning with / are relative to the origin hosting this document. Exports require no JavaScript, cookies, API key, or browser engine.

## Overloads

### overload-b252120666e69efb

Kind: scalar. Parameter order: catalog-order.

```text
strftime(data: DATE, format: VARCHAR) → VARCHAR
```

Link: /products/haybarn/functions/releases/haybarn-1.5.5-rc3/strftime/#overload-b252120666e69efb

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| data | DATE | not recorded |
| format | VARCHAR | not recorded |

Declared return type: VARCHAR. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-c50bc68240a13248

Kind: scalar. Parameter order: catalog-order.

```text
strftime(data: TIMESTAMP WITH TIME ZONE, format: VARCHAR) → VARCHAR
```

Link: /products/haybarn/functions/releases/haybarn-1.5.5-rc3/strftime/#overload-c50bc68240a13248

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| data | TIMESTAMP WITH TIME ZONE | not recorded |
| format | VARCHAR | not recorded |

Declared return type: VARCHAR. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-c1d00c0595b586c7

Kind: scalar. Parameter order: catalog-order.

```text
strftime(data: TIMESTAMP_NS, format: VARCHAR) → VARCHAR
```

Link: /products/haybarn/functions/releases/haybarn-1.5.5-rc3/strftime/#overload-c1d00c0595b586c7

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| data | TIMESTAMP_NS | not recorded |
| format | VARCHAR | not recorded |

Declared return type: VARCHAR. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-601c1850c359b0eb

Kind: scalar. Parameter order: catalog-order.

```text
strftime(data: TIMESTAMP, format: VARCHAR) → VARCHAR
```

Link: /products/haybarn/functions/releases/haybarn-1.5.5-rc3/strftime/#overload-601c1850c359b0eb

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| data | TIMESTAMP | not recorded |
| format | VARCHAR | not recorded |

Declared return type: VARCHAR. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-b914d1a5a82b2b25

Kind: scalar. Parameter order: catalog-order.

```text
strftime(data: VARCHAR, format: DATE) → VARCHAR
```

Link: /products/haybarn/functions/releases/haybarn-1.5.5-rc3/strftime/#overload-b914d1a5a82b2b25

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| data | VARCHAR | not recorded |
| format | DATE | not recorded |

Declared return type: VARCHAR. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-0deeea9026d73dee

Kind: scalar. Parameter order: catalog-order.

```text
strftime(data: VARCHAR, format: TIMESTAMP) → VARCHAR
```

Link: /products/haybarn/functions/releases/haybarn-1.5.5-rc3/strftime/#overload-0deeea9026d73dee

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| data | VARCHAR | not recorded |
| format | TIMESTAMP | not recorded |

Declared return type: VARCHAR. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-7ab2ff8e0ae5fff1

Kind: scalar. Parameter order: catalog-order.

```text
strftime(data: VARCHAR, format: TIMESTAMP WITH TIME ZONE) → VARCHAR
```

Link: /products/haybarn/functions/releases/haybarn-1.5.5-rc3/strftime/#overload-7ab2ff8e0ae5fff1

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| data | VARCHAR | not recorded |
| format | TIMESTAMP WITH TIME ZONE | not recorded |

Declared return type: VARCHAR. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-5936b03b5f9b90f2

Kind: scalar. Parameter order: catalog-order.

```text
strftime(data: VARCHAR, format: TIMESTAMP_NS) → VARCHAR
```

Link: /products/haybarn/functions/releases/haybarn-1.5.5-rc3/strftime/#overload-5936b03b5f9b90f2

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| data | VARCHAR | not recorded |
| format | TIMESTAMP_NS | not recorded |

Declared return type: VARCHAR. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.


## Guide recipes

No guide recipes.

## Engine catalog examples

Source examples may require additional data or extensions. Expressions are wrapped in SELECT; execution verification is not recorded.

Reported for: overload-b252120666e69efb, overload-c50bc68240a13248, overload-c1d00c0595b586c7, overload-601c1850c359b0eb, overload-b914d1a5a82b2b25, overload-0deeea9026d73dee, overload-7ab2ff8e0ae5fff1, overload-5936b03b5f9b90f2

```sql
SELECT strftime(date '1992-01-01', '%a, %-d %B %Y');
```

## Runnable examples

Executed successfully in Haybarn WASM 1.5.5-rc3. Sample data and guide examples are separate from the original catalog.

```sql
SELECT strftime(date '1992-01-01', '%a, %-d %B %Y');
```

## Additional DuckDB documentation

- [Date Format Functions](https://duckdb.org/docs/current/sql/functions/dateformat)
- [Date Functions](https://duckdb.org/docs/current/sql/functions/date#strftimedate-format)
- [Timestamp Functions](https://duckdb.org/docs/current/sql/functions/timestamp#strftimetimestamp-format)

## In other engines

### PostgreSQL: to_char()

Timestamp formatting

PostgreSQL:

```sql
SELECT
  TO_CHAR(created_at, 'YYYY-MM-DD HH24:MI:SS');
```

Haybarn / DuckDB:

```sql
SELECT
  STRFTIME(created_at, '%Y-%m-%d %H:%M:%S');
```

Translation from [SQLGlot](https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/sqlglot/dialects/postgres.py).

### Apache Hive: date_format()



Apache Hive:

```sql
DATE_FORMAT('2020-01-01', 'yyyy-MM-dd HH:mm:ss')
```

Haybarn / DuckDB:

```sql
STRFTIME(CAST('2020-01-01' AS TIMESTAMP), '%Y-%m-%d %H:%M:%S')
```

Translation from [SQLGlot](https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_hive.py#L432).

### BigQuery: format_date()



BigQuery:

```sql
SELECT FORMAT_DATE('%Y%m%d', '2023-12-25')
```

Haybarn / DuckDB:

```sql
SELECT STRFTIME(CAST('2023-12-25' AS DATE), '%Y%m%d')
```

Translation from [SQLGlot](https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_bigquery.py#L3224).

### MySQL: date_format()



MySQL:

```sql
SELECT DATE_FORMAT('2021-01-01 22:23:00', '%x')
```

Haybarn / DuckDB:

```sql
SELECT STRFTIME(CAST('2021-01-01 22:23:00' AS TIMESTAMP), '%G')
```

Translation from [SQLGlot](https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_mysql.py#L843).

### Presto: date_format()



Presto:

```sql
DATE_FORMAT(x, '%Y-%m-%d %H:%i:%S')
```

Haybarn / DuckDB:

```sql
STRFTIME(x, '%Y-%m-%d %H:%M:%S')
```

Translation from [SQLGlot](https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_presto.py#L310).

### SQLite: strftime()



SQLite:

```sql
SELECT STRFTIME('%Y-%m-%d', CURRENT_TIMESTAMP)
```

Haybarn / DuckDB:

```sql
SELECT STRFTIME(CAST(CURRENT_TIMESTAMP AS TIMESTAMP), '%Y-%m-%d')
```

Translation from [SQLGlot](https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_sqlite.py#L341).

### Snowflake



Snowflake:

```sql
SELECT DAYNAME(TO_DATE('2025-01-15'))
```

Haybarn / DuckDB:

```sql
SELECT STRFTIME(CAST('2025-01-15' AS DATE), '%a')
```

Translation from [SQLGlot](https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_snowflake.py#L2983).

## Observed availability

| Snapshot | Observed | Overloads | JSON |
| --- | --- | --- | --- |
| haybarn-1.5.5-rc3 | present | 8 | [reference](/products/haybarn/functions/api/v1/haybarn-1.5.5-rc3/functions/strftime.json) |
| duckdb-1.5.5 | present | 8 | [reference](/products/haybarn/functions/api/v1/duckdb-1.5.5/functions/strftime.json) |
| duckdb-1.4.4 | present | 7 | [reference](/products/haybarn/functions/api/v1/duckdb-1.4.4/functions/strftime.json) |
| duckdb-1.3.2 | present | 7 | [reference](/products/haybarn/functions/api/v1/duckdb-1.3.2/functions/strftime.json) |

Engine catalog documentation is derived from MIT-licensed Haybarn and DuckDB. [Notices](/third-party-notices.txt).
