We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df5e5ae commit 4285309Copy full SHA for 4285309
pythainlp/util/strftime.py
@@ -32,11 +32,10 @@ def _std_strftime(dt_obj: datetime, fmt_char: str) -> str:
32
str_ = ""
33
try:
34
str_ = dt_obj.strftime(f"%{fmt_char}")
35
- if str_ == f"%{fmt_char}":
+ if not str_ or str_ == "%{}".format(fmt_char):
36
# normalize outputs for unsupported directives
37
# in different platforms
38
- # unsupported "%Q" in platform A may return "Q"
39
- # unsupported "%Q" in platform A may return "%Q"
+ # "%Q" may result "%Q", "Q", or "", make it "Q"
40
str_ = fmt_char
41
except ValueError as err:
42
# Unsupported directives may raise ValueError on Windows,
0 commit comments