Open
Description
Bug Report
Description
The parse_date
function returns a wrong result, when using an RFC 2822 date with timezone.
In [24]: parse_date('Thu, 20 May 2021 13:38:44 +0300')
Out[24]: (1621517924, -10800)
This output is wrong.
1621517924
is supposed to be UTC time (10:38:44
).
But instead, it is my time (13:38:44
)
Source Code Investigation
The function calls are as following:
repo.index.commit
takesauthor_date
as input, which is anRFC 2822
string.repo.index.commit
callsCommit.create_from_tree
withauthor_date
.Commit.create_from_tree
callsparse_date(author_date)
to parse the date intoauthor_time
andauthor_offset
.Commit.create_from_tree
callscls
(akaCommit.__init__
) passingauthor_time
andauthor_offset
.Commit.__init__
savesauthor_time
andauthor_offset
inauthored_date
andauthor_tz_offset
.
Thus, the fault should lie with the parse_date
function.
Environment
Tried with versions 2.1.11
and 3.1.14
.