MCPcopy Create free account
hub / github.com/adobe/react-spectrum / epochFromDate

Function epochFromDate

packages/@internationalized/date/src/conversion.ts:31–43  ·  view source on GitHub ↗
(date: AnyDateTime)

Source from the content-addressed store, hash-verified

29import {Mutable} from './utils';
30
31export function epochFromDate(date: AnyDateTime): number {
32 date = toCalendar(date, new GregorianCalendar());
33 let year = getExtendedYear(date.era, date.year);
34 return epochFromParts(
35 year,
36 date.month,
37 date.day,
38 date.hour,
39 date.minute,
40 date.second,
41 date.millisecond
42 );
43}
44
45function epochFromParts(
46 year: number,

Callers 7

addZonedFunction · 0.90
cycleZonedFunction · 0.90
parseZonedDateTimeFunction · 0.90
possibleAbsolutesFunction · 0.85
toAbsoluteFunction · 0.85
zonedToDateFunction · 0.85
toTimeZoneFunction · 0.85

Calls 3

getExtendedYearFunction · 0.90
toCalendarFunction · 0.85
epochFromPartsFunction · 0.85

Tested by

no test coverage detected