%a, %d %b %Y %H:%M:%S GMT(assuming you are using the "C" or a english local, and UTC time). In python this would be:
$ python
>>> import datetime
>>> datetime.datetime.utcnow().strftime("%a, %d %b %Y %H:%M:%S GMT")
'Sun, 30 Sep 2007 14:58:05 GMT'
>>>
Note, the "%a, " is optional.
Good luck looking that up directly. It's on page 55 of RFC 1123, which it's just a change to RFC 822 to be "year 2000 compliant" so you have go track down the original spec (it's in section 5). Which is in BNC format.
I should really make a master page listing standard time formats and their equivalent strftime format.
2 comments:
Why on earth are you reading an RFC on a Sunday afternoon?
Why on earth am I reading this blog post on a Sunday afternoon?
Thank you. Very useful.
Post a Comment