code: 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)
docs: Convert milliseconds since epoch UTC to datetime.