Welcome, guest | Sign In | My Account | Store | Cart

This recipe will help you parse datetime strings returned by HTTP servers following the RFC 2616 standard (which supports three datetime formats). Credit for this recipe goes to ΤΖΩΤΖΙΟΥ.

Python, 5 lines
1
2
3
4
5
from datetime import datetime
from email.utils import parsedate

def _parse_http_datetime(s):
    return datetime(*parsedate(s)[:6])

1 comment

Sridhar Ratnakumar (author) 13 years, 2 months ago  # | flag

This is just a test comment; testing code deployment ...