mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Adding a date format with seconds.
This commit is contained in:
parent
3d6bf828fd
commit
a6dc53fe20
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
|
||||
"""
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue