26.03.2019, 17:21
(25.03.2019, 07:34)admin Wrote: Apixu free tier does not provide astronomy data. Moon phase calculation is relatively simple. Here's a formula that gives number of days since new moon cycle:
Code:local date = os.date('*t') local y, m, d = date.year, date.month, date.day if m < 3 then y = y - 1 m = m + 12 end local a = math.floor(y / 100) local b = math.floor(a / 4) local c = 2 - a + b local e = math.floor(365.25 * (y + 4716)) local f = math.floor(30.6001 * (m + 1)) local jd = c + d + e + f - 1524.5 local dn = jd - 2451549.5 local nm = dn / 29.53 local dc = (nm % 1) * 29.53 log(dc)
Thanks Admin,
Is there a way to get what phase the moon is in right now?
BR Even Sundgot.