ametaireau/pelican — Issue #184: DEFAULT_DATE_FORMAT not honored
Author: PingTrip
Created: 2011-11-07 17:04:11+00:00
State: open

It doesn't appear that DEFAULT_DATE_FORMAT is taken into consideration in the get_date function in Utils.py. Is this as intended?

```
def get_date(string):
"""Return a datetime object from a 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', '%Y-%m-%d %H:%M:%S']
for date_format in formats:
try:
return datetime.strptime(string, date_format)
except ValueError:
pass
raise ValueError("'%s' is not a valid date" % string)
```