def METHOD_NAME(self, dt, timespec):
        """convert datetime to string in UTC format (YYYY-mm-ddTHH:MM:SS.mmmZ)"""
        iso_str = dt.astimezone(timezone.utc).isoformat('T', timespec)
        return iso_str.replace('+00:00', 'Z')