nntp/date.py
def timestamp_a__d_b_Y_H_M_S_z(value):
    """Convert timestamp string to time in seconds since epoch.

    Timestamps strings like 'Tue, 18 Jun 2013 22:00:00 +1000' are able to be
    converted by this function.

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

    Returns:
        The time in seconds since epoch as an integer.

    Raises:
        ValueError: If timestamp is invalid.
        KeyError: If the abbrieviated month is invalid.
    """
    a, d, b, Y, t, z = value.split()
    H, M, S = t.split(":")
    return int(calendar.timegm((
        int(Y), _months[b.lower()], int(d), int(H), int(M), int(S), 0, 0, 0
    ))) - _offset(z)
def timestamp_a__d_b_Y_H_M_S_z(value):
    """Convert timestamp string to time in seconds since epoch.

    Timestamps strings like 'Tue, 18 Jun 2013 22:00:00 +1000' are able to be
    converted by this function.

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

    Returns:
        The time in seconds since epoch as an integer.

    Raises:
        ValueError: If timestamp is invalid.
        KeyError: If the abbrieviated month is invalid.
    """
    a, d, b, Y, t, z = value.split()
    H, M, S = t.split(":")
    return int(calendar.timegm((
        int(Y), _months[b.lower()], int(d), int(H), int(M), int(S), 0, 0, 0
    ))) - _offset(z)
Convert timestamp string to time in seconds since epoch.

    Timestamps strings like 'Tue, 18 Jun 2013 22:00:00 +1000' are able to be
    converted by this function.

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

    Returns:
        The time in seconds since epoch as an integer.

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