Improve date handling

This commit is contained in:
Klaus-Uwe Mitterer 2015-03-18 23:51:26 +01:00
parent 99e45fadec
commit 10001b0c28

View file

@ -39,10 +39,10 @@ while True:
try:
if "-" in text:
loc = text.find("-")
date = dateutil.parser.parse(text[:loc-1])
date = dateutil.parser.parse(text[:loc-1],dayfirst=True,fuzzy=True)
comment = HTMLParser.HTMLParser().unescape(text[loc+1:]).strip()
else:
date = dateutil.parser.parse(text)
date = dateutil.parser.parse(text,dayfirst=True,fuzzy=True)
comment = ""
except ValueError:
api.update_status("@%s Sorry, ich verstehe deinen Tweet nicht... :(" % sender, twid)