code: def to_isostring(dt):
      
      if dt.tzinfo is not None and dt.tzinfo.utcoffset(dt) > timedelta(0):
          logging.warn('Warning: aware datetimes are interpreted as if they were naive')
  
      # -3 to change microseconds to milliseconds
      return dt.strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3] + 'Z'
docs: Converts the given datetime to an ISO String.
      This assumes the datetime is UTC.