I am working with survey data and there is a variable called "timestamp". Here is an observation from that variable: 2021-10-15T15:02:39.624Z.

How can I generate two new variable, month and year, from this timestamp. I can do it with one observations but would like to put it in loop.

Here is what I did so far:
HTML Code:
​​​​​​gen year_month = subinstr("2021-10-15T15:02:39.624Z", "-15T15:02:39.624Z", "",.)