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.
我有这样的字符串时间戳:
“格林威治标准时间 2013 年 7 月 31 日星期三 13:03:38”
我在 python 文档中看不到任何内容,但我可能错过了它。
或者,如果不是,我假设我可以对字符串进行一些解析——因为它有一个固定的格式。关于如何开始的任何指示都会有所帮助。
这些日期符合 RFC 822。
是的!你需要使用strptime()
strptime()
import time time.strptime("30 Nov 00", "%d %b %y")
这是文档的链接:
http://docs.python.org/2/library/time.html#time.strptime