toCalendarfunction
A moment as a date and time of day in UTC, in the Gregorian or the Julian calendar.
Import it
import { toCalendar } from "@johnmorrisdotca/wakusei-planets/time";
Definition
function toCalendar(when: When, calendar?: Calendar): CivilTime
Parameters
| Name | Type | Description |
|---|---|---|
when | When | A |
calendar (optional) | Calendar |
|
Returns
CivilTime
The year (astronomical), month, day, hour, minute, second and millisecond.
Examples
import { toCalendar } from "@johnmorrisdotca/wakusei-planets/time";
console.log(toCalendar(Date.UTC(1582, 9, 15)), toCalendar(Date.UTC(1582, 9, 15), "julian").day);{
year: 1582,
month: 10,
day: 15,
hour: 0,
minute: 0,
second: 0,
millisecond: 0
} 5What it prints (run when this page was built)