aboutsummaryrefslogtreecommitdiffstats
path: root/blue.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-06 20:00:37 +0200
committerMattias Andrée <maandree@kth.se>2016-07-06 20:00:47 +0200
commit7f9475446daf1ec7d2153f24a7405ed857048709 (patch)
tree649ec1601ad2de0fbd08f83d6fddc20f1c72dfe4 /blue.py
parentFix automatic stop date, was one day too late (diff)
downloadblue-7f9475446daf1ec7d2153f24a7405ed857048709.tar.gz
blue-7f9475446daf1ec7d2153f24a7405ed857048709.tar.bz2
blue-7f9475446daf1ec7d2153f24a7405ed857048709.tar.xz
Fix error in days per months table
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'blue.py')
-rwxr-xr-xblue.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/blue.py b/blue.py
index 8eb4d87..27d1823 100755
--- a/blue.py
+++ b/blue.py
@@ -217,7 +217,7 @@ else:
m = 12
y -= 1
days = 29 if y % 400 == 0 or (y % 4 == 0 and not y % 100 == 0) else 28
- days = [31, days, 31, 30, 31, 30, 30, 31, 30, 31, 30, 31]
+ days = [31, days, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
d = days[m - 1]
stop_date = (y, m, d)
@@ -235,7 +235,7 @@ else:
break
(y, m, d) = stop_date
days = 29 if y % 400 == 0 or (y % 4 == 0 and not y % 100 == 0) else 28
- days = [31, days, 31, 30, 31, 30, 30, 31, 30, 31, 30, 31]
+ days = [31, days, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
stop_time = d - 1
for i in range(m - 1):
stop_time += days[i]
@@ -245,6 +245,7 @@ else:
stop_time *= 24 * 60 * 60
stop_time += 24 * 60 * 60
stop_time -= (time.altzone if is_summer else time.timezone)
+ print('Z ', time.gmtime(stop_time))
def get_elev(elev, start, morning):