nntp/date.py
def datetimeobj_d_b_Y_H_M_S(value):
    """Convert timestamp string to a datetime object.

    Timestamps strings like '18 Jun 2013 12:00:00 GMT' are able to be converted
    by this function.

    Args:
        value: A timestamp string in the format '%d %b %Y %H:%M:%S GMT'.

    Returns:
        A datetime object.

    Raises:
        ValueError: If timestamp is invalid.
        KeyError: If the abbrieviated month is invalid.

    Note: The timezone is ignored it is simply assumed to be UTC/GMT.
    """
    d, b, Y, t, Z = value.split()
    H, M, S = t.split(":")
    return datetime.datetime(
        int(Y), _months[b.lower()], int(d), int(H), int(M), int(S), tzinfo=TZ_GMT
    )
def datetimeobj_d_b_Y_H_M_S(value):
    """Convert timestamp string to a datetime object.

    Timestamps strings like '18 Jun 2013 12:00:00 GMT' are able to be converted
    by this function.

    Args:
        value: A timestamp string in the format '%d %b %Y %H:%M:%S GMT'.

    Returns:
        A datetime object.

    Raises:
        ValueError: If timestamp is invalid.
        KeyError: If the abbrieviated month is invalid.

    Note: The timezone is ignored it is simply assumed to be UTC/GMT.
    """
    d, b, Y, t, Z = value.split()
    H, M, S = t.split(":")
    return datetime.datetime(
        int(Y), _months[b.lower()], int(d), int(H), int(M), int(S), tzinfo=TZ_GMT
    )
Convert timestamp string to a datetime object.

    Timestamps strings like '18 Jun 2013 12:00:00 GMT' are able to be converted
    by this function.

    Args:
        value: A timestamp string in the format '%d %b %Y %H:%M:%S GMT'.

    Returns:
        A datetime object.

    Raises:
        ValueError: If timestamp is invalid.
        KeyError: If the abbrieviated month is invalid.

    Note: The timezone is ignored it is simply assumed to be UTC/GMT.