Example 1 — Same Instant in Two Locales (UTC)
Pin timeZone: "UTC" so the clock stays predictable across machines.
const event = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
const utc = { timeZone: "UTC" };
console.log(event.toLocaleTimeString("en-US", utc)); // "3:00:00 AM"
console.log(event.toLocaleTimeString("en-GB", utc)); // "03:00:00" How It Works
- Build a UTC instant.
Date.UTC(..., 3, 0, 0)is 03:00 UTC. - Fix the zone.
timeZone: "UTC"ignores the machine’s local offset. - Format for the US. 12-hour clock with AM/PM →
"3:00:00 AM". - Format for Britain. 24-hour clock →
"03:00:00".

