Having a issue with utc_datetime

I have a utc_datetime like this

but I need to change this to


I tried some examples but didn’t work.

I’m using a library DateTime for this

What are your data types, are those strings?

Yes it’s a string

Calendar is used for this. Trying that

So what exactly are you trying to do, give it to us step by step?

Like, get the date/time externally from an API (as a string) and wanting to reformat it with the Z at the back?

Hey. I already solved the problem. Thanks

Care to share how? It would be useful for future readers.