Merge pull request #140 from borgar/date-with-seconds

Adding a date format with seconds.
This commit is contained in:
Simon Liedtke 2011-06-30 07:24:09 -07:00
commit 9dc9fc1d40

View file

@ -15,7 +15,7 @@ def get_date(string):
If no format matches the given date, raise a ValuEerror
"""
formats = ['%Y-%m-%d %H:%M', '%Y/%m/%d %H:%M', '%Y-%m-%d', '%Y/%m/%d',
'%d/%m/%Y', '%d.%m.%Y', '%d.%m.%Y %H:%M']
'%d/%m/%Y', '%d.%m.%Y', '%d.%m.%Y %H:%M', '%Y-%m-%d %H:%M:%S']
for date_format in formats:
try:
return datetime.strptime(string, date_format)