pyca/utils.py
def unix_ts(dtval):
    '''Convert datetime into a unix timestamp.
    This is the equivalent to Python 3's int(datetime.timestamp()).

    :param dt: datetime to convert
    '''
    epoch = datetime(1970, 1, 1, 0, 0, tzinfo=tzutc())
    delta = (dtval - epoch)
    return delta.days * 24 * 3600 + delta.seconds
def unix_ts(dtval):
    '''Convert datetime into a unix timestamp.
    This is the equivalent to Python 3's int(datetime.timestamp()).

    :param dt: datetime to convert
    '''
    epoch = datetime(1970, 1, 1, 0, 0, tzinfo=tzutc())
    delta = (dtval - epoch)
    return delta.days * 24 * 3600 + delta.seconds
def unix_ts ( dtval ) : epoch = datetime ( 1970 , 1 , 1 , 0 , 0 , tzinfo = tzutc ( ) ) delta = ( dtval - epoch ) return delta . days * 24 * 3600 + delta . seconds
Convert datetime into a unix timestamp.
    This is the equivalent to Python 3's int(datetime.timestamp()).

    :param dt: datetime to convert
Convert datetime into a unix timestamp . This is the equivalent to Python 3 s int ( datetime . timestamp () ) .