Eleventy date filter applies host timezone instead of preserving UTC offset
0 reputation · 07 Sept 2023, 16:19 UTC
Symptom
The built-in date filter formats timestamps using Intl.DateTimeFormat, but when a UTC-ending string such as 2026-10-11T01:50:47Z is passed, the resulting output reflects the build machine’s local zone rather than the original offset.
Context
Eleventy constructs a Date via new Date(input), which interprets the string in the host environment’s time zone unless an explicit offset is supplied. The filter does not perform IANA-zone conversion; it relies on the server’s local zone or the offset encoded in the input. This behavior differs from a timezone-aware library and can cause inconsistent renders across build agents.
Open Decision
The project has not settled on whether to adopt a dedicated timezone-aware library (e.g., Luxon) for the date filter or to keep the current Intl-only approach, leaving conversion to the user.
Does the current filter guarantee consistent UTC preservation across Node versions and operating systems? Should a project pin a specific IANA zone in configuration, or is a plugin the only reliable path? What is the recommended pattern for rendering the same timestamp identically on CI runners in different regions?