Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是交易。我有一个用 C# 编写的工具(不是我的,无法更改),除其他外,它会打印到当前语言环境中的日志时间和日期。 到目前为止一切顺利......我想编写一个解析这个的python代码。 “正确”的方式是datetime.strptime作为locale.nl_langinfo(locale.D_T_FMT)格式字符串给出。 可惜!我在 Windows 上(其中语言环境对象没有 D_T_FMT) 有什么 优雅的方法可以绕过这个吗?
datetime.strptime
locale.nl_langinfo(locale.D_T_FMT)