Dates
Dates
One vocabulary of format names, understood identically by Twig, by plain JavaScript and by Vue. The server prints a <time> carrying the instant and the format it was asked for; the browser picks it up and rewrites it as it ages, so a page left open never lies about how long ago something happened.
Named formats
Absolute formats are ICU date and time styles, so the field order and the separators belong to the reader's locale rather than to the template.
- time
- date_short
- date
- date_long
- date_time_short
- date_time
- date_time_full
- month_year
Relative
The distance is counted in the largest unit that still says something — minutes up to an hour, hours up to a day, then days, weeks, months and years. Every wording comes from a translation key.
- A moment ago
- Five minutes
- Three hours
- Two days
- Four months
- Three years
- In two hours
Auto
The default. Counts backwards while the date is recent, and falls back to a calendar date past a week, where "27 weeks ago" stops helping anyone.
- Three hours
- Two days
- Four months
Kept up to date
A single timer serves every date on the page, at the cadence the displayed unit deserves — a few seconds for "just now", an hour for "3 months ago". Leave this page open and watch.
Rendered by Twig, refreshed by the front service:
Rendered by Vue:
Text only
The filter returns a string with no markup, for a title attribute or an export. A format name it does not know is taken as a raw ICU pattern, which is the way out when the named formats do not have the shape you need.
- | date_format('date_long')
- March 14, 2026
- | date_format("EEEE d MMMM, 'week' w")
- Saturday 14 March, week 11