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

# Date Format

Available in

Formats a date or datetime as text, using a pattern you choose. Pair it
with Compose String to put a date inside a longer string.

### Inputs

* **Date** — the date or datetime to format.

### Outputs

* **Result** — the formatted text.

### Pattern

Each `%` directive is replaced by a part of the date; everything else is
copied as written. Blank means `%Y-%m-%d`.

| Directive | Meaning | Example |
| - | - | - |
| `%Y` | Year | `2026` |
| `%y` | Two-digit year | `26` |
| `%m` | Month, zero-padded | `03` |
| `%-m` | Month, no padding | `3` |
| `%d` | Day of the month, zero-padded | `07` |
| `%-d` | Day of the month, no padding | `7` |
| `%H` | Hour (00–23) | `09` |
| `%I` | Hour (01–12) | `09` |
| `%p` | AM / PM | `AM` |
| `%M` | Minute | `05` |
| `%S` | Second | `00` |
| `%B` | Month name | `March` |
| `%b` | Abbreviated month name | `Mar` |
| `%A` | Weekday name | `Saturday` |
| `%a` | Abbreviated weekday name | `Sat` |
| `%j` | Day of the year | `066` |
| `%z` | UTC offset | `+0100` |
| `%Z` | Time zone abbreviation | `CET` |
| `%%` | A literal `%` | `%` |

Examples: `%d/%m/%Y` gives `07/03/2026`; `%Y-%m-%dT%H:%M:%S%z` gives
`2026-03-07T09:05:00+0100`. Month and weekday names are in English.

A plain date has no time of day, so `%H`, `%M` and `%S` print as `00`.
`%z` and `%Z` print nothing for a date or a datetime without a zone.

### Timezone

Optional IANA zone name (e.g. `Europe/Stockholm`). When set, a datetime
is converted to that zone before it is formatted, so `%H` reads the local
hour. Leave it blank to format in UTC. Dates ignore the field.

## Ports


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