TimeZone { return new TimeZone('+0000'); } /** * JST ͷ߹ɺ -540 Λ +0900 ʹม͢Δɻ */ static offsetToIsoTimeZone(offset: number): TimeZone { const min = Math.abs(offset); const isoTimeZone = [ `00${Math.floor(min / 60)}`.slice(-2), `00${min - Math.floor(min / 60) * 60}`.slice(-2), ].join(''); const sign = offset <= 0 ? '+' : '-'; return new TimeZone(`${sign}${isoTimeZone}`); } constructor(protected value: string) { super(value); assert(/^[+-]\d{4}/.test(value), `"${value}" ɺλΠϜκʔϯͷϑΥʔϚοτͰ͋Γ·ͤΜ`); } }