(millis, opts)
Convert milliseconds since epoch UTC to datetime.
Convert milliseconds since epoch UTC to datetime.
Convert milliseconds since epoch UTC to datetime .
def _millis_to_datetime(millis, opts):
    """Convert milliseconds since epoch UTC to datetime."""
    diff = ((millis % 1000) + 1000) % 1000
    seconds = (millis - diff) / 1000
    micros = diff * 1000
    if opts.tz_aware:
        dt = EPOCH_AWARE + datetime.timedelta(seconds=seconds,
                                              microseconds=micros)
        if opts.tzinfo:
            dt = dt.astimezone(opts.tzinfo)
        return dt
    else:
        return EPOCH_NAIVE + datetime.timedelta(seconds=seconds,
                                                microseconds=micros)
def _millis_to_datetime ( millis , opts ) : diff = ( ( millis % 1000 ) + 1000 ) % 1000 seconds = ( millis - diff ) / 1000 micros = diff * 1000 if opts . tz_aware : dt = EPOCH_AWARE + datetime . timedelta ( seconds = seconds , microseconds = micros ) if opts . tzinfo : dt = dt . astimezone ( opts . tzinfo ) return dt else : return EPOCH_NAIVE + datetime . timedelta ( seconds = seconds , microseconds = micros )