Adding migration api wrapper (#899)

Closes #818
This commit is contained in:
Shubham Singh
2018-12-21 12:01:01 +08:00
committed by Wan Liuyang
parent cd6d56d60a
commit b4d895eddd
21 changed files with 564 additions and 3 deletions
+1 -1
View File
@@ -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")