def datetime_to_long(dt):
 return timedelta_to_usecs((dt - dt.min))

def datetime_to_long ( dt ) : return timedelta_to_usecs ( ( dt - dt . min ) )
converts a datetime object to a long integer representing the number of microseconds since datetime .