How to update iso string date

I have this iso string


horaFinal: “2019-05-27T17:15:17.581Z”

and now I suddenly need to change programatically the date from 2019-05-27 to 2019-06-02, how do I do it?
Do I need to transform the iso string to a date object and then do setDate?
Can I change it somehow right away in the string?