fromCalendarfunction
A date and time of day in UTC as a moment, in milliseconds since 1970. A day that does not exist (31 April, 29 February in a common year, or 5 to 14 October 1582 in the auto calendar) throws a RangeError.
Import it
import { fromCalendar } from "@johnmorrisdotca/wakusei-planets/time";
Definition
function fromCalendar(civil: { year: number; } & Partial<Omit<CivilTime, "year">>, calendar?: Calendar): number
Parameters
| Name | Type | Description |
|---|---|---|
civil | { year: number; } & Partial<Omit<CivilTime, "year">> | The year (astronomical), and the month (1), day (1), hour, minute, second and millisecond (0) when left out. |
calendar (optional) | Calendar |
|
Returns
number
Milliseconds since 1970.
Examples
import { fromCalendar } from "@johnmorrisdotca/wakusei-planets/time";
console.log(fromCalendar({ year: 333, month: 1, day: 27, hour: 12 }, "julian"), new Date(fromCalendar({ year: 2000, month: 1, day: 1, hour: 12 })).toISOString());-51656356800000 2000-01-01T12:00:00.000ZWhat it prints (run when this page was built)