---
description: Formatting dates and times in a template with Luxon — the start/end attributes for the current item and for upcoming and daily rows, luxon-field/luxon-format for any field, the tokens, literal text, locales, accepted input values and what happens with bad values or format strings.
---

# Time formatting

Every item carries ready-made strings such as `start_time_ampm` and `end_time_weekday`
(see [Template data fields](dynamic_fields.md)). When you need another format, language or
field, the sign formats the value for you with [Luxon](https://moment.github.io/luxon/):
you put a **format string** in an attribute, the sign parses the value in the event's time
zone and writes the result into the element. Luxon is injected by the sign; do not bundle it.

## The attributes

| Attribute | Formats | Where it works |
| --- | --- | --- |
| `start-time-format`, `end-time-format` | The current item's `time_start` / `time_end` | Anywhere in a room template; inside `data-event-timeline` and `data-room-schedule` rows of an event scoped template |
| `upcoming-start-time-format`, `upcoming-end-time-format` | Each row's start / end | Inside the row template of an [upcoming items container](upcoming_items_templates.md) |
| `daily-start-time-format`, `daily-end-time-format` | Each row's start / end | Inside the row template of a [daily schedule container](daily_schedule_templates.md) |
| `luxon-format` with `luxon-field="path"` (or with `data-field`) | Any date-time field | Everywhere, including nested lists and `data-event-rooms` cells (`luxon-field="current_item.time_start"`) |

```html
<!-- current item -->
<span start-time-format="HH:mm"></span>                      <!-- 18:30 -->
<span end-time-format="h:mm a"></span>                       <!-- 7:00 PM -->
<span start-time-format="'Starts at' hh:mm a"></span>        <!-- Starts at 06:30 PM -->

<!-- another field: epoch millis, epoch seconds, ISO or SQL-style strings all parse -->
<span luxon-field="sessionStartTime" luxon-format="cccc, M/d"></span>
<span data-field="publishedAt" luxon-format="LLLL d, yyyy"></span>

<!-- inside an upcoming row template -->
<span upcoming-start-time-format="h:mm a"></span> – <span upcoming-end-time-format="h:mm a"></span>
```

`luxon-format` can share the element with `data-field` only when the element binds a single
plain value; with `data-attribute` or `data-html` it is ignored.

## Tokens

The format string mixes tokens and literal text (literal text in single quotes):

| Token | Meaning | Example |
| --- | --- | --- |
| `yyyy`, `yy` | Year | `2025`, `25` |
| `LLLL`, `LLL`, `LL`, `L` | Month name, short name, two-digit number, number | `August`, `Aug`, `08`, `8` |
| `d`, `dd` | Day of month | `7`, `07` |
| `cccc`, `ccc` | Weekday name, short | `Thursday`, `Thu` |
| `HH`, `H` | Hour, 24-hour clock | `18`, `6` |
| `hh`, `h` | Hour, 12-hour clock | `06`, `6` |
| `mm` | Minutes | `05` |
| `ss` | Seconds | `09` |
| `a` | AM/PM | `PM` |
| `ZZZZ`, `z` | Time zone name | `CEST`, `Europe/Oslo` |

`MMMM`/`MMM`/`MM` and `EEEE`/`EEE` are accepted as synonyms for the month and weekday tokens.
The complete list is in Luxon's [table of tokens](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).

```html
<span start-time-format="LLLL d, yyyy"></span>     <!-- August 7, 2025 -->
<span end-time-format="cccc HH:mm"></span>         <!-- Thursday 19:00 -->
```

## Locales

Append `{locale: xx}` to the format string to get month and weekday names in another
language:

```html
<span start-time-format="d LLLL yyyy {locale: fr}"></span>              <!-- 7 août 2025 -->
<span end-time-format="ccc HH:mm {locale: de}"></span>                  <!-- Do 19:00 -->
<span start-time-format="yyyy年M月d日 (ccc) {locale: ja}"></span>       <!-- 2025年8月7日 (木) -->
<span upcoming-start-time-format="EEEE d MMMM {locale: fr-FR}"></span>  <!-- jeudi 7 août -->
```

Without a locale the names are in English. A locale the sign's browser does not have falls
back to the default.

## Input values and time zone

`luxon-field` accepts epoch milliseconds (`1744459200000`), epoch seconds (`1744459200`),
ISO strings (`2026-04-12T09:30:00Z`) and SQL-style wall-clock strings
(`2026-04-12 09:30:00`). A string without an offset is read in the event's time zone, and
every result is written in the event's time zone — the sign device's own zone never
matters.

## When something is wrong

- A **missing or unparsable value** hides the element (`display: none`) and shows it again
  when a later item has the value. A `luxon-field` that points at a field the item does not
  have therefore produces no stray text.
- An **invalid format string** does *not* hide the element: Luxon prints unknown tokens as
  literal characters, so `luxon-format="bbb"` renders `bbb` and `"xyz"` renders the year and
  zone glued to an `x`. Use the documented tokens, quote literal text, and preview the
  template in the app — the preview formats exactly as the sign does.

## Related

- [Template data fields](dynamic_fields.md) — the ready-formatted strings
- [Upcoming items container](upcoming_items_templates.md) and [Daily schedule container](daily_schedule_templates.md)
- [Event scoped templates](event_scoped_templates.md) — which attributes work in which container
