def unix_time(dt):
    epoch = datetime.datetime.utcfromtimestamp(0)
delta = dt - epoch
return delta.total_seconds()

def unix_time_millis(dt):
    return int(unix_time(dt) * 1000.0)
How to insert a datetime into a Cassandra 1.2 timestamp column