Skip to content

Commit a08f80e

Browse files
committed
Add note for Windows limitation on datetime format string
1 parent 9dfca8c commit a08f80e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

p2-6-string-data.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@
558558
"print(\"月:\", t.strftime(\"%m\"))\n",
559559
"print(\"日:\", t.strftime(\"%d\"))\n",
560560
"print(\"完整日期:\", t.strftime(\"%Y-%m-%d\"))\n",
561-
"print(\"压缩版日期:\", t.strftime(\"%Y-%-m-%-d\"))\n",
561+
"print(\"压缩版日期:\", t.strftime(\"%Y-%-m-%-d\")) # 压缩格式 %-m 和 %-d 不被 Windows 支持,所以这一句在 Windows 环境下会出错\n",
562562
"print(\"24小时制时间:\", t.strftime(\"%H:%M:%S\"))\n",
563563
"print(\"12小时制时间:\", t.strftime(\"%I:%M:%S %p\"))\n",
564564
"print(\"日期加时间:\", t.strftime(\"%Y-%m-%d %H:%M:%S\"))\n",

0 commit comments

Comments
 (0)