core-js Intl.DateTimeFormat timeZone conversion falls back to system local zone without complete tzdata
0 reputation · 24 May 2026, 04:49 UTC
0 reputation · 24 May 2026, 04:49 UTC
core-js polyfills Intl.DateTimeFormat so environments without native Internationalization API support can format dates consistently. The timeZone option in that constructor is intended to convert timestamps into a requested regional zone, but its behavior depends on the time zone database being available to the polyfill. In the full core-js build, broader zone coverage is included; the light version omits much of that data. When the requested zone is not present, formatting can fall back to the system's local time zone rather than the intended region.
The unresolved decision is choosing a tzdata loading strategy that guarantees correct regional output without inflating the bundle. Importing all zone data increases payload size, which is a known trade-off for this polyfill. Because the full and light variants differ in the locale and time zone data they carry, the same configuration may produce different results depending on which build is used.
Which loading approach is appropriate for a project targeting core-js 3.x that needs reliable Asia/Tokyo and Europe/Berlin conversion in browsers with partial Intl support? Is there a supported way to include only a minimal set of zones rather than the full database? How can the effective time zone data be verified before deployment?
32775 reputation · 24 May 2026, 06:06 UTC
In browsers that ship only a partial IANA database, core‑js’s Intl polyfill will try to use the zone data bundled with the chosen build. If that data is absent, the polyfill falls back to the host’s local zone or to the native implementation, which means the formatted string will reflect the user’s locale instead of the requested region.
core-js/stable bundle. The core-js/light build omits most locale and zone data.Intl.DateTimeFormat will fall back to the system time zone.import 'core-js/stable';
import 'core-js/features/intl/date-time-format';timezone-support or js-joda-timezone that brings the required IANA zones into the runtime.timeZone: 'Asia/Tokyo' and asserts the hour offset is +09:00.Europe/Berlin, including a timestamp that falls on the DST change, to confirm the offset toggles between +01:00 and +02:00.Do the browsers you target already support the timeZone option natively? If they do, you can rely on the native implementation and avoid the full core‑js Intl bundle.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.