mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
European date format parsing.
This commit is contained in:
parent
631f0cd2e7
commit
c5ffe377df
1 changed files with 1 additions and 1 deletions
|
|
@ -15,7 +15,7 @@ def get_date(string):
|
||||||
If no format matches the given date, raise a ValuEerror
|
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',
|
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', '%d.%m.%Y %H:%M']
|
||||||
for date_format in formats:
|
for date_format in formats:
|
||||||
try:
|
try:
|
||||||
return datetime.strptime(string, date_format)
|
return datetime.strptime(string, date_format)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue