MCPcopy
hub / github.com/node-cron/node-cron / getOffsetFormatter

Function getOffsetFormatter

src/time/localized-time.ts:137–148  ·  view source on GitHub ↗
(timezone?: string)

Source from the content-addressed store, hash-verified

135}
136
137function getOffsetFormatter(timezone?: string): Intl.DateTimeFormat {
138 const key = timezone ?? '';
139 let formatter = offsetFormatterCache.get(key);
140 if (!formatter) {
141 formatter = new Intl.DateTimeFormat('en-US', {
142 timeZone: timezone,
143 timeZoneName: 'shortOffset'
144 });
145 offsetFormatterCache.set(key, formatter);
146 }
147 return formatter;
148}
149
150function buildDateParts(date: Date, timezone?: string): DateParts {
151 const dateFormat = getPartsFormatter(timezone);

Callers 1

getTimezoneGMTFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected