Skip to content

Commit

Permalink
Adjust time calculation for programme start times
Browse files Browse the repository at this point in the history
As described by Ulrick Brink, start times of programmes appear on the wrong days.
  • Loading branch information
nickpiggott committed Jul 14, 2020
1 parent ce4a93d commit eb5f18f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/spi/binary/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def encode_timepoint(timepoint):
y = timepoint.year + 4800 - a
m = timepoint.month + (12 * a) - 3
jdn = timepoint.day + ((153 * m) + 2) / 5 + (365 * y) + (y / 4) - (y / 100) + (y / 400) - 32045
jd = jdn + (timepoint.hour - 12) / 24 + timepoint.minute / 1440 + timepoint.second / 86400
jd = jdn + timepoint.hour / 24 + timepoint.minute / 1440 + timepoint.second / 86400
mjd = (int)(jd - 2400000.5)
bits += encode_number(mjd, 17)

Expand Down

0 comments on commit eb5f18f

Please sign in to comment.