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.
我需要使用正确的时区格式化日期/时间并使用此格式字符串:%Y-%m-%dT%H:%M:%S. 但是,它使用的是当地时间。如何使其格式化时间,包括时区,或使用 UTC 时间?
%Y-%m-%dT%H:%M:%S
您可以使用%Z或%z添加时区。
strftime 只能生成本地时间。