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

    Timestamps strings like '1383470155' are able to be converted by this
    function.

    Args:
        value: A timestamp string as seconds since epoch.

    Returns:
        A datetime object.

    Raises:
        ValueError: If timestamp is invalid.
    """
    return datetime.datetime.utcfromtimestamp(int(value)).replace(tzinfo=TZ_GMT)
def datetimeobj_epoch(value):
    """Convert timestamp string to a datetime object.

    Timestamps strings like '1383470155' are able to be converted by this
    function.

    Args:
        value: A timestamp string as seconds since epoch.

    Returns:
        A datetime object.

    Raises:
        ValueError: If timestamp is invalid.
    """
    return datetime.datetime.utcfromtimestamp(int(value)).replace(tzinfo=TZ_GMT)
Convert timestamp string to a datetime object.

    Timestamps strings like '1383470155' are able to be converted by this
    function.

    Args:
        value: A timestamp string as seconds since epoch.

    Returns:
        A datetime object.

    Raises:
        ValueError: If timestamp is invalid.