Example 1 — Same Instant in Two Locales (UTC)
Pin timeZone: "UTC" so the clock part stays predictable across machines.
const event = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
const utc = { timeZone: "UTC" };
console.log(event.toLocaleString("en-GB", utc));
// "20/12/2012, 03:00:00"
console.log(event.toLocaleString("ko-KR", utc));
// "2012. 12. 20. 오전 3:00:00" How It Works
- Build a UTC instant.
Date.UTC(2012, 11, 20, 3, 0, 0)is Dec 20, 2012 at 03:00 UTC. - Fix the zone.
timeZone: "UTC"stops local offset from shifting the clock. - Format for Britain. Day/month order and 24-hour time.
- Format for Korea. Year-first order and a 12-hour period marker.

