MCPcopy
hub / github.com/date-fns/date-fns / formatTimezone

Function formatTimezone

pkgs/core/src/_lib/format/formatters/index.ts:791–797  ·  view source on GitHub ↗
(offset: number, delimiter: string = "")

Source from the content-addressed store, hash-verified

789}
790
791function formatTimezone(offset: number, delimiter: string = ""): string {
792 const sign = offset > 0 ? "-" : "+";
793 const absOffset = Math.abs(offset);
794 const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
795 const minutes = addLeadingZeros(absOffset % 60, 2);
796 return sign + hours + delimiter + minutes;
797}

Callers 2

index.tsFile · 0.85

Calls 1

addLeadingZerosFunction · 0.90

Tested by

no test coverage detected