From 0900a51f986f3ed736d9556b3296d37933018196 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 8 Nov 2015 15:09:41 +0100 Subject: fix(commit): respect daylight saving when computing utc-offset Related to #362 --- git/ext/gitdb | 2 +- git/objects/commit.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/git/ext/gitdb b/git/ext/gitdb index 9aae93ea..2389b752 160000 --- a/git/ext/gitdb +++ b/git/ext/gitdb @@ -1 +1 @@ -Subproject commit 9aae93ea584c8cf9d1539a60e41c5c37119401d6 +Subproject commit 2389b75280efb1a63e6ea578eae7f897fd4beb1b diff --git a/git/objects/commit.py b/git/objects/commit.py index 376b451d..d067b718 100644 --- a/git/objects/commit.py +++ b/git/objects/commit.py @@ -27,7 +27,10 @@ from git.compat import text_type from time import ( time, - altzone + daylight, + altzone, + timezone, + localtime ) import os from io import BytesIO @@ -327,7 +330,8 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable): # PARSE THE DATES unix_time = int(time()) - offset = altzone + is_dst = daylight and localtime().tm_isdst > 0 + offset = altzone if is_dst else timezone author_date_str = env.get(cls.env_author_date, '') if author_date: -- cgit v1.2.3