def datetime_to_epoch(dt):
 delta = (dt - epoch)
 since_epoch = delta.total_seconds()
 return since_epoch

def datetime_to_epoch ( dt ) : delta = ( dt - epoch ) since_epoch = delta . total_seconds ( ) return since_epoch
convert datetime object to epoch with millisecond accuracy .