mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
committed by
Wan Liuyang
parent
cd6d56d60a
commit
b4d895eddd
@@ -170,7 +170,7 @@ class GithubObject(object):
|
||||
# The Downloads API has been removed. I'm keeping this branch because I have no mean
|
||||
# to check if it's really useless now.
|
||||
return datetime.datetime.strptime(s, "%Y-%m-%dT%H:%M:%S.000Z") # pragma no cover (This branch was used only when creating a download)
|
||||
elif len(s) == 25:
|
||||
elif len(s) >= 25:
|
||||
return datetime.datetime.strptime(s[:19], "%Y-%m-%dT%H:%M:%S") + (1 if s[19] == '-' else -1) * datetime.timedelta(hours=int(s[20:22]), minutes=int(s[23:25]))
|
||||
else:
|
||||
return datetime.datetime.strptime(s, "%Y-%m-%dT%H:%M:%SZ")
|
||||
|
||||
Reference in New Issue
Block a user