Learning center

Replay the reporter's time zone and locale

A number shows as 1.234,5 for one tester and 1,234.5 for another. A date falls on the wrong day only for users in Tokyo. A sort order puts Ä in the wrong place. These bugs follow the browser's locale and time zone, not the code path the steps describe. Capture both from the reporter's browser and run the reproduction with the same values.

Capture what the browser used#

Ask the reporter to run this in the Console on the affected page:

({
  timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
  locale: Intl.DateTimeFormat().resolvedOptions().locale,
  languages: navigator.languages,
  offsetMinutes: new Date().getTimezoneOffset(),
  now: new Date().toString(),
})

Copy the result into the report. navigator.languages is the browser's preference list, which the browser also sends as Accept-Language. The resolved locale is what Intl formatting actually used. The time zone is an IANA name such as America/Sao_Paulo, which is more useful than an offset because offsets change with daylight saving time. MDN: Intl.DateTimeFormat.prototype.resolvedOptions()

Also note the account's own locale and time zone settings if the app has them, since server-rendered text may follow the account and client-rendered text the browser.

Replay them#

In Playwright, set both on the context:

const context = await browser.newContext({ locale: 'de-DE', timezoneId: 'Asia/Tokyo' });

We checked what that changes in Chromium. The page saw navigator.language as de-DE, the resolved time zone as Asia/Tokyo, (1234.5).toLocaleString() as 1.234,5, and the instant 2026-11-30T20:00Z formatted as the date 1.12.2026, because 20:00 UTC is already the next morning in Tokyo. The server received Accept-Language: de-DE. Playwright: Locale and time zone

In Chrome DevTools, the Sensors panel overrides the time zone and locale for the open tab. Codegen takes --lang and --timezone to record under the same conditions.

Choose zones that expose the bug#

If the reporter's zone is not known, test the zones most likely to break date code:

ZoneWhy
Pacific/Kiritimati (UTC+14) and Pacific/Pago_Pago (UTC−11)The widest offsets: a UTC date shifts a full day
Asia/Kolkata (UTC+5:30), Asia/Kathmandu (UTC+5:45)Offsets that are not whole hours
America/Sao_Paulo, Europe/Berlin, America/New_YorkDaylight saving changes, on different dates
Australia/Lord_HoweA daylight saving change of 30 minutes

And locales that format differently from English: de-DE for decimal commas, fr-FR for a narrow no-break space as the thousands separator, ar-EG for Arabic-Indic digits, ja-JP for year-first dates.

Worked example: a total that doubled#

This example is fictional. A tester in Germany reports that entering 1,5 hours in a timesheet saves 15 hours. The developer enters 1.5 and it saves correctly.

The tester's capture shows locale: "de-DE". The input displayed numbers with the browser's locale, so German users typed a decimal comma, and the save handler removed commas as thousands separators before calling parseFloat. Replaying with locale: 'de-DE' and typing 1,5 saved 15 hours every time. The fix parsed input with the same locale that formatted it.

Questions#

Does setting the time zone also change the server's behavior?

Only through what the browser sends. The time zone is not a request header, so the server sees it only if the app sends it, for example in an API parameter. The Accept-Language header does reach the server.

Can I change the time zone for the whole machine instead?

On Linux and macOS, starting a browser with the TZ environment variable set often works. Playwright's timezoneId is more reliable because it applies to that one context.

What about the date itself?

Some bugs need a particular day, such as the end of a month or a daylight saving change. Fake the clock sets the date along with the zone.

Return to reproducing what someone else saw for the other layers a replay needs.

One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. Eligibility and fair-use terms.

Start free with GitHub

Related reading