def unix_time(dt):
    epoch = datetime.datetime.utcfromtimestamp(0)
    delta = dt - epoch
    return int((delta.microseconds + (delta.seconds + delta.days * 24 * 3600) * 10**6) / 10**6)
Return unix time in microseconds
dataset/ETHPy150Open WeatherDecisionTechnologies/flask-pika/flask_pika.py/unix_time