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 · The Sun and Moon from a place: position, sunrise and sunset, Moon rise, set and phase, with suncalc 2's names and a better engine

getMoonTimesfunction

The Moon's rise, set and transits over a day at a place.

Import it

import { getMoonTimes } from "@johnmorrisdotca/wakusei-planets/suncalc";

Definition

function getMoonTimes(date: Date | number, lat: number, lng: number, utcOffset?: number): MoonTimes

Parameters

NameTypeDescription
datenumber | Date

Any moment of the day, as a Date (or milliseconds since 1970).

latnumber

Degrees north, -90 to 90.

lngnumber

Degrees east (west negative).

utcOffset (optional)number | undefined

Minutes east of UTC: when given the day is the local calendar day holding date; when left out it is the solar day holding date.

Returns

MoonTimes

rise, set, transit (the Moon highest) and lowerTransit (lowest) as Dates, each absent on a day without it, with alwaysUp or alwaysDown when the Moon never crosses the horizon.

Examples

import { getMoonTimes } from "@johnmorrisdotca/wakusei-planets/suncalc";

const t = getMoonTimes(new Date(Date.UTC(2026, 10, 7, 12)), 35.7, 139.7, 540);
console.log(Object.keys(t).length > 0);
true

What it prints (run when this page was built)

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