lol
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
_LEADING_SYMBOL = "#" if os.name == "nt" else "-"
|
||||
|
||||
# https://docs.python.org/3/library/datetime.html#technical-detail (see NOTE #9)
|
||||
_DATETIME_STRIP_ZERO_PADDING_FORMATS_RE = re.compile(
|
||||
f"%{_LEADING_SYMBOL}["
|
||||
"%-["
|
||||
"d" # day of month
|
||||
"m" # month
|
||||
"H" # hour (24-hour)
|
||||
@@ -28,7 +26,7 @@ def clean_datetime_format_for_strptime(formats):
|
||||
return [
|
||||
re.sub(
|
||||
_DATETIME_STRIP_ZERO_PADDING_FORMATS_RE,
|
||||
lambda m: m[0].replace(_LEADING_SYMBOL, ""),
|
||||
lambda m: m[0].replace("-", ""),
|
||||
format,
|
||||
)
|
||||
for format in formats
|
||||
|
||||
Reference in New Issue
Block a user