Better date parsing (still not good enough, have to find out how to parse the timezone, anyone?)

This commit is contained in:
Ask Solem
2009-04-21 13:36:27 +02:00
parent 433206f5c2
commit a6aab83e4e
+1 -1
View File
@@ -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)