fix dst again

This commit is contained in:
Yannik Schmidt
2021-12-28 10:58:29 +01:00
committed by GitHub
parent 84e3354b55
commit 2527347ff8

View File

@@ -14,8 +14,8 @@ def time_from_dbf(l, timeformat):
offset_d = datetime(1970,1,1)-datetime(1900,1,1) offset_d = datetime(1970,1,1)-datetime(1900,1,1)
shit_epoch = l*24*60*60 #days to seconds shit_epoch = l*24*60*60 #days to seconds
unix_epoch = datetime.fromtimestamp(shit_epoch) - offset_d unix_epoch = datetime.fromtimestamp(shit_epoch) - offset_d
isDaylightSavingsTime = time.localtime(unix_epoch.timestamp()) isDaylightSavingsTime = time.localtime(unix_epoch.timestamp()).tm_isdst
if isDaylightSavingsTime: if not isDaylightSavingsTime:
unix_epoch -= timedelta(hours=1) unix_epoch -= timedelta(hours=1)
return (unix_epoch - timedelta(days=2) ).replace(microsecond=0) return (unix_epoch - timedelta(days=2) ).replace(microsecond=0)