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

Function getDateTimeZone

pkgs/core/src/_lib/tp/index.ts:25–35  ·  view source on GitHub ↗
(
  date: DateArg<DateType>,
)

Source from the content-addressed store, hash-verified

23}
24
25function getDateTimeZone<DateType extends Date>(
26 date: DateArg<DateType>,
27): string {
28 if (
29 typeof date === "object" &&
30 "timeZone" in date &&
31 typeof date.timeZone === "string"
32 )
33 return date.timeZone;
34 return Temporal.Now.timeZoneId();
35}
36
37export function fromTp<
38 DateType extends Date,

Callers 1

toTpInstantFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected