MCPcopy
hub / github.com/formatjs/formatjs / YearFromTime

Function YearFromTime

packages/ecma262-abstract/DateOperations.ts:25–27  ·  view source on GitHub ↗
(t: number)

Source from the content-addressed store, hash-verified

23}
24
25export function YearFromTime(t: number): number {
26 return new Date(t).getUTCFullYear()
27}
28
29export function DaysInYear(y: number): 365 | 366 {
30 if (y % 4 !== 0) return 365

Callers 3

ToLocalTimeFunction · 0.85
DayWithinYearFunction · 0.85
InLeapYearFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected