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

Function parseOffsetMinutes

src/time/localized-time.ts:188–194  ·  view source on GitHub ↗
(isoString: string)

Source from the content-addressed store, hash-verified

186
187
188function parseOffsetMinutes(isoString: string): number | null {
189 if (isoString.endsWith('Z')) return 0;
190 const match = isoString.match(/([+-])(\d{2}):(\d{2})$/);
191 if (!match) return null;
192 const sign = match[1] === '+' ? 1 : -1;
193 return sign * (parseInt(match[2]) * 60 + parseInt(match[3]));
194}
195
196function getTimezoneGMT(date: Date, timezone?: string) {
197 const fmt = getOffsetFormatter(timezone);

Callers 1

getOffsetMinutesFunction · 0.85

Calls 1

matchMethod · 0.65

Tested by

no test coverage detected