We sign download links with a Unix timestamp rendered by {{ time | date: "%s" }}. Since we started rendering pages in each customer's timezone, the timestamp for one and the same moment differs between regions, and signa…
We sign download links with a Unix timestamp rendered by {{ time | date: "%s" }}. Since we started rendering pages in each customer's timezone, the timestamp for one and the same moment differs between regions, and signature checks fail. A Unix timestamp counts the seconds since 1970-01-01 UTC, so it must not depend on the timezone used for display.
{{ "2026-06-30T21:00:00Z" | date: "%s", "America/Toronto" }}.{{ "2026-06-30T21:00:00Z" | date: "%s", 360 }}.{{ "2026-06-30T21:00:00Z" | date: "%s" }} with the engine option timezoneOffset: "Asia/Tokyo".1782853200 in all three, the same as without any timezone.
178283880017828316001782885600{{ "2026-06-30T21:00:00Z" | date: "%Y-%m-%d %H:%M", "Asia/Tokyo" }} gives 2026-07-01 06:00, and that is correct.2026-06-30T17:00:00.900Z is second 1782838800.Adapted from harttle/liquidjs (MIT).
Visible test command
TZ=UTC npx --no-install jest --ci --coverage=falseThe repository’s own tests. Run all tests includes them, and so does every submission.
Repository
unix-timestamp-shifts-with-timezone
Changes under src/ are evaluated.