mirror of
https://github.com/acamarata/moon-cycle.git
synced 2026-07-01 11:14:31 +00:00
770 B
770 B
moon-cycle / SYNODIC_MONTH
Variable: SYNODIC_MONTH
constSYNODIC_MONTH:29.53058821398858=29.53058821398858
Defined in: types.ts:51
Length of one synodic month in days.
IAU mean value at J2000.0. Used by cycleMonth to divide the elapsed
time into a fractional position within the current lunar cycle.
Example
import { SYNODIC_MONTH } from 'moon-cycle';
// Days old: how far into the current cycle
const now = new Date();
const elapsed = (now.getTime() - MONTH_ANCHOR.getTime()) / 86400000;
const age = ((elapsed % SYNODIC_MONTH) + SYNODIC_MONTH) % SYNODIC_MONTH;