How to show a date in another time zone
Short answer
A date object stores one moment. The timeZone option shows that moment as the clock in a given city:
const moment = new Date(Date.UTC(2025, 5, 1, 12, 0));
console.log(moment.toLocaleString('en-GB', { timeZone: 'Asia/Tokyo' }));Output:
01/06/2025, 21:00:00Several cities
Intl.DateTimeFormat is convenient for repeated formatting:
const moment = new Date(Date.UTC(2025, 5, 1, 12, 0));
const cities = ['Europe/London', 'Europe/Berlin', 'America/New_York'];
for (const timeZone of cities) {
const time = new Intl.DateTimeFormat('en-GB', { timeZone, hour: '2-digit', minute: '2-digit' }).format(moment);
console.log(timeZone, time);
}Output:
Europe/London 13:00
Europe/Berlin 14:00
America/New_York 08:00The user's time zone
resolvedOptions() tells which time zone the browser uses:
const zone = Intl.DateTimeFormat().resolvedOptions().timeZone;
console.log(typeof zone);Output:
stringCommon mistake
Adding hours to the date by hand to change the time zone breaks during daylight saving time changes. Format with timeZone and keep the moment itself unchanged.
const moment = new Date(Date.UTC(2025, 2, 30, 12, 0));
console.log(moment.toLocaleString('en-GB', { timeZone: 'Europe/Berlin' }));Output:
30/03/2025, 14:00:00Functions used in this recipe
- Date.prototype.toLocaleString — Formats a date together with the time by language rules.
- Intl.DateTimeFormat — Formats dates and times by language rules.