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

Function getOffsetMinutes

src/time/localized-time.ts:51–54  ·  view source on GitHub ↗

* Returns the timezone offset, in minutes, for the given instant * (local - UTC). e.g. New York in winter (EST) returns -300.

(date: Date, timezone?: string)

Source from the content-addressed store, hash-verified

49 * (local - UTC). e.g. New York in winter (EST) returns -300.
50 */
51function getOffsetMinutes(date: Date, timezone?: string): number {
52 const offset = parseOffsetMinutes(getTimezoneGMT(date, timezone).replace(/^GMT/, '') || 'Z');
53 return offset ?? 0;
54}
55
56/**
57 * Returns true if the given instant, read back in the timezone, matches the

Callers 1

localTimeToTimestampFunction · 0.85

Calls 2

parseOffsetMinutesFunction · 0.85
getTimezoneGMTFunction · 0.85

Tested by

no test coverage detected