MCPcopy Create free account
hub / github.com/11ty/parse-date-strings / getTimezoneOffset

Method getTimezoneOffset

parse.js:10–18  ·  view source on GitHub ↗
(offset = "Z")

Source from the content-addressed store, hash-verified

8 static IS_FRACTIONAL_REGEX = /^\d+[\.\,]\d+$/;
9
10 static getTimezoneOffset(offset = "Z") {
11 let [, hours = "0", minutes = "0"] = offset.match(this.TIMEZONE_REGEX) ?? [];
12
13 let sign = hours[0] === '-' ? -1 : 1;
14 return {
15 hours: parseInt(hours, 10),
16 minutes: parseInt(minutes, 10) * sign
17 };
18 }
19
20 /** @param {RegExpMatchArray} match */
21 static getByDateTime(

Callers 1

getByDateTimeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected