>>> import time
>>> time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime())
'Fri, 20 May 2005 11:08:40 GMT'
>>> t = time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime(time.time()))
>>> t
'Fri, 20 May 2005 11:22:20 GMT'
>>> time.strptime(t, "%a, %d %b %Y %H:%M:%S GMT")
(2005, 5, 20, 11, 22, 20, 4, 140, -1)
So what these tell us? Well, the format string is:
"%a, %d %b %Y %H:%M:%S GMT"
That's it. Yes, it is GMT time, no timezone there.
没有评论:
发表评论