mirror of
https://github.com/kennethreitz-archive/github2.git
synced 2026-06-05 23:50:18 +00:00
Better date parsing (still not good enough, have to find out how to parse the timezone, anyone?)
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ GITHUB_DATE_FORMAT = "%Y/%m/%d %H:%M:%S"
|
||||
|
||||
|
||||
def ghdate_to_datetime(github_date):
|
||||
date_without_tz = github_date.rsplit("-")[0].strip()
|
||||
date_without_tz = " ".join(github_date.strip().split()[:2])
|
||||
return datetime.strptime(date_without_tz, GITHUB_DATE_FORMAT)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user