'Normalize a time to be an int measured in microseconds.'

def _NormalizeTime(self, time):

    if isinstance(time, rdfvalue.RDFDatetime):
        return time.AsMicroSecondsFromEpoch()
    if isinstance(time, rdfvalue.Duration):
        return time.microseconds
    return int(time)
