summaryrefslogtreecommitdiff
path: root/git/objects/commit.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-11-08 15:09:41 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-11-08 15:09:41 +0100
commit0900a51f986f3ed736d9556b3296d37933018196 (patch)
tree425585ec25985a0886850d891d536c7a47c563b5 /git/objects/commit.py
parenta929ab29016e91d661274fc3363468eb4a19b4b2 (diff)
downloadgitpython-0900a51f986f3ed736d9556b3296d37933018196.tar.gz
fix(commit): respect daylight saving when computing utc-offset
Related to #362
Diffstat (limited to 'git/objects/commit.py')
-rw-r--r--git/objects/commit.py8
1 files changed, 6 insertions, 2 deletions
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: