JavaScript Required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
Coda on the Moon
Coda on the Moon
Moon Pack
Coda Moon Formula
Base Tables
More
Share
Explore
Coda Moon Formula
In case you don’t want the pack but just a basic reference to the current lunar phase (without other interesting and super geeky information), here’s a genuine, full-Coda formula to calculate lunar phase with a given date (you can edit info on
Static Lunar Phases
):
Select Date:
4/18/2022
[Show Southern Hemisphere?
]
Moon Phase on
4/18/2022
is :
5
→
Waning Gibbous Moon
🌖
Code (
calc_MoonPhase
named variable above)
calc_Date.WithName(date,
If(date.Month() < 3, date.Year() - 1, date.Year())
.WithName(year,
WithName(
If(date.Month() < 3, date.Month() + 12, date.Month()) + 1,
month,
date.Day().WithName(day,
WithName(
((365.25 * year + 30.6 * month + day - 694039.09) /
29.5305882),
jd,
Round(((jd.Truncate() - jd) * -1) * 8)
.WithName(
phase, if(phase = 8, 0, phase)
)
)
)
)
)
)
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.