Loading...
const berlinOffset = 2; // hours
const local = new Date(utc.getTime() + berlinOffset * 3600000);const format = new Intl.DateTimeFormat('de-DE', {
timeZone: 'Europe/Berlin',
dateStyle: 'medium',
timeStyle: 'short',
});
const local = format.format(utc);A fixed offset breaks after daylight saving changes; a named time zone lets Intl apply the right offset for each date.
Intl.DateTimeFormat with the user's timeZone, not manual offset math.Call Intl.DateTimeFormat().resolvedOptions().timeZone, which returns an IANA name like 'Europe/Berlin'.
Store the IANA name for future local events. Offsets change with daylight saving and law changes, names keep the rules.
For apps they show the same time. UTC is the precise time standard, GMT is a time zone name used in the UK in winter.