diff --git a/skyglow.py b/skyglow.py index 50e855db31ccf20f17628530f066dc47718627d0..d5d66e5a71bfb87b18e0e903f3c1f408b23c4a18 100755 --- a/skyglow.py +++ b/skyglow.py @@ -62,7 +62,7 @@ sunrise = 0 sunset = 0 #datetime.now(timezone.utc) #create aware! #utcnow() / utcfromtimestamp() -now = dt.now().replace(second=0, microsecond=0) # ignore seconds and microseconds +now = dt.utcnow().replace(second=0, microsecond=0) # ignore seconds and microseconds #mlx (idx is also dmx-byte value) moon = [ 1.409, @@ -229,9 +229,15 @@ def init(): elif( now.month == 8 or (now.month == 9 and now.day <= 15 )): sunrise = 7 sunset = 20 - else: + elif( now.month == 9 or (now.month == 10 and now.day < 25 )): sunrise = 7 sunset = 19 + elif( now.month in [10,11,12,1] or now.month == 2 and now.day < 2 ): + sunrise = 8 + sunset = 16 + else: + sunrise = 8 + sunset = 17 def isDay(): return ((now.hour >= sunrise) and (now.hour < sunset))