Natively support the %Y/%m/%d date format
For parsing dates such as 2020/01/25, as seen on https://github.com/envoyproxy/envoy/blob/main/RELEASES.md#major-release-schedule.
This commit is contained in:
@@ -12,6 +12,7 @@ def parse_date(text: str, formats: list[str] = frozenset([
|
||||
"%d-%B-%Y", # 1-January-2020
|
||||
"%Y-%m-%d", # 2020-01-01
|
||||
"%m/%d/%Y", # 01/25/2020
|
||||
"%Y/%m/%d", # 2020/01/25
|
||||
])) -> datetime:
|
||||
"""Parse a given text representing a date using a list of formats.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user