Date and time filters
Formatting and arithmetic on dates. date is standard Shopify Liquid; the rest are extensions. Every filter here accepts the same inputs and normalises them to UTC:
- an ISO 8601 date (
2026-04-12) — midnight UTC; - an ISO 8601 datetime, with an offset/
Z(2026-04-12T13:45:00Z) or without (interpreted as UTC); - a Unix timestamp in seconds (integer or numeric string);
- the literal
"now"or"today".
date
Formats a date with a strftime-style format string. The format argument defaults to %Y-%m-%d. Supported directives: %Y %m %d %H %M %S %B %b %A %a %j %p %Z %z %% (unknown directives pass through unchanged).
{{ "2026-04-12" | date: "%B %Y" }} <!-- April 2026 -->
{{ "2026-04-12T13:45:00Z" | date: "%H:%M" }} <!-- 13:45 -->
{{ "now" | date: "%Y" }} <!-- current year -->
date_add
(extension) Adds a number of seconds to a date, returning an ISO 8601 UTC string.
{{ "now" | date_add: 172800 }} <!-- 48 hours from now -->
{{ "2026-01-01T00:00:00Z" | date_add: 3600 }} <!-- 2026-01-01T01:00:00Z -->
unix_to_iso
(extension) Converts a Unix timestamp (seconds since the epoch) to an ISO 8601 UTC string.
{{ 1767225600 | unix_to_iso }} <!-- 2026-01-01T00:00:00Z -->
Jekyll date filters
Four fixed-format filters matching Jekyll / LiquidJS. Each takes no argument.
date_to_string
(extension) Short date — %d %b %Y.
{{ "2026-07-07T13:07:59Z" | date_to_string }} <!-- 07 Jul 2026 -->
date_to_long_string
(extension) Long date — %d %B %Y.
{{ "2026-07-07T13:07:59Z" | date_to_long_string }} <!-- 07 July 2026 -->
date_to_rfc822
(extension) RFC 822 date-time — the form RSS feeds use.
{{ "2026-07-07T13:07:59Z" | date_to_rfc822 }} <!-- Tue, 07 Jul 2026 13:07:59 +0000 -->
date_to_xmlschema
(extension) ISO 8601 / XML-schema date-time — the form Atom feeds and sitemaps use.
{{ "2026-07-07T13:07:59Z" | date_to_xmlschema }} <!-- 2026-07-07T13:07:59+00:00 -->
The RFC 822 and XML-schema forms make it straightforward to emit valid RSS/Atom feeds and sitemaps from a template.
See also
- XML documents — compose feeds and sitemaps
- When a filter errors