You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Timezone offset from UTC is wrong when not in DST #362
It turns out that the Europe/Paris timezone just got out of DST and is now in UTC+1 back from UTC+2. It means that dates should currently be recorded with +0100. date does it correctly:
$ TZ='Europe/Paris' date +"%Y-%m-%dT%H:%M:%S%z"
2015-11-04T08:45:34+0100
However, GitPython uses time.altzone to guess dates in commits, which yields +0200 instead of +0100:
While the date is still correct, the timezone is now wrong. Indeed, using time.altzone is only correct when:
time.daylight is non zero, eg. the current timezone has a DST defined at some point in the year (always true for Europe/Paris, but always false for Indian/Reunion)
and DST is currently active, which you can check with time.localtime().tm_isdst > 0.
Activity
fix(commit): respect daylight saving when computing utc-offset
Byron commentedon Nov 8, 2015
Thanks for taking the time to create this awesome and informative issue ! It's much appreciated.
As I am unable to post new releases to pypi, I hope you will be able to use the latest version on HEAD and let me know if this fixes your problem.
pquentin commentedon Nov 8, 2015
Thank you for the fix! It works perfectly.