def UTCMillisToDatetime(millis, tz=None):
  """Converts a millisecond epoch time to a datetime object.

  Args:
    millis: A UTC time, expressed in milliseconds since the epoch.
    tz: The desired tzinfo for the datetime object. If None, the
        datetime will be naive.
  Returns:
    The datetime represented by the input value.
  """
  return UTCMicrosToDatetime(millis * 1000, tz)