Skip to the content

Wakusei Planets惑星

The Sun, the planets and their moons as a clean line drawing, a shaded realistic drawing or a painted surface map, with real sizes, tilt and rotation, and the moons where they are at any date and time.

Wakusei is the Japanese word 惑星 for a planet. About the name

Contents

Reference · Julian dates (and the julian package's functions), calendars, time scales, sidereal time and Mars time

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

NameTypeDescription
whenWhen

A Date or milliseconds since 1970 (UTC).

calendar (optional)Calendar

auto (default: the calendar in use that day), gregorian or julian for every year.

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
} 5

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/wakusei-planets 0.24.0.