Fix the way the times are converted from UNIX epoch (1970/01/01 00:00:00) to Modified Julian Day. The use of fromtimestamp() uses the current time zone (which as of now happens to be British Summer Time in the UK) and is therefore potentially unsafe. This can be avoided by explicitly forcing fromtimestamp() to use UTC (fromtimestamp(x, tz=pytz.UTC) using the datetime-tz module, or, using utcfromtimestamp() instead (which seems simpler...)