Skip to content

Commit 0173a49

Browse files
committed
Fixed datetime to commit date formatting.
Dates can now roundtrip.
1 parent 448c352 commit 0173a49

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

github2/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
GITHUB_DATE_FORMAT = "%Y/%m/%d %H:%M:%S"
77
#2009-03-21T18:01:48-07:00
88
COMMIT_DATE_FORMAT = "%Y-%m-%dT%H:%M:%S"
9+
COMMIT_TIMEZONE = "-07:00"
910

1011

1112
def strptime(string, format):
@@ -55,7 +56,7 @@ def datetime_to_commitdate(datetime_):
5556
:param str datetime_: datetime object to convert
5657
"""
5758
date_without_tz = datetime_.strftime(COMMIT_DATE_FORMAT)
58-
return "".join([date_without_tz, GITHUB_TIMEZONE])
59+
return "".join([date_without_tz, COMMIT_TIMEZONE])
5960

6061

6162
class GithubCommand(object):

0 commit comments

Comments
 (0)