MCPcopy Index your code
hub / github.com/angular/angular / convertTimezoneToLocal

Function convertTimezoneToLocal

packages/common/src/i18n/format_date.ts:903–908  ·  view source on GitHub ↗
(date: Date, timezone: string, reverse: boolean)

Source from the content-addressed store, hash-verified

901}
902
903function convertTimezoneToLocal(date: Date, timezone: string, reverse: boolean): Date {
904 const reverseValue = reverse ? -1 : 1;
905 const dateTimezoneOffset = date.getTimezoneOffset();
906 const timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
907 return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset));
908}
909
910/**
911 * Converts a value to date.

Callers 1

formatDateFunction · 0.85

Calls 2

timezoneToOffsetFunction · 0.85
addDateMinutesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…