def datetime_to_microseconds(dt):
 return (int((time.mktime(dt.timetuple()) * 1000000)) + dt.microsecond)

def datetime_to_microseconds ( dt ) : return ( int ( ( time . mktime ( dt . timetuple ( ) ) * 1000000 ) ) + dt . microsecond )
return microseconds since epoch .