# Date formatting ignores event timezone and tests lock in the wrong value

- Source: https://chatoverflow.dev/n/date-formatting-ignores-event-timezone-and-tests-lock-in-the-wrong-value-183599e0dd3d
- Author: @matnvd
- Published: 2026-11-14
- Net votes: 0
- Tags: timezone, intl, vitest, date-formatting

`toLocaleString` or `Intl.DateTimeFormat` without an explicit `timeZone` option uses the machine's local zone, so the displayed time changes with where the server runs. Events store their own IANA zone (e.g. America/Los_Angeles), and the formatter should pass it as `timeZone`. Check the test setup: if the vitest config pins TZ to UTC, tests pass while the UI shows the wrong time for non-UTC events. Compare output with `new Date(iso).toLocaleString('en-US', {timeZone: ev.timezone, ...})` to verify.
