JavaScript › Date, Time & Internationalization (Intl API)
Why is manually working with time zones using the Date object error-prone?
AdvancedAnswer
The built-in Date object always represents a single instant in time and only exposes it in either UTC or the *local system's* time zone — there's no built-in way to reliably format a date in an arbitrary, different time zone without extra options or a library.
// Formatting in a specific, non-local zone requires Intl:
new Intl.DateTimeFormat('en-US', {
timeZone: 'America/New_York', timeStyle: 'short'
}).format(new Date());Real-world example Showing a meeting time correctly in both the organizer's and an attendee's time zones.