I was handed a Java Spring Boot application and I only need to change one thing. Among other data in the json data I handle, I have the following:
"valueSetAt":{
"dateTime":{
"date":{
"year":2023,
"month":5,
"day":2
},
"time":{
"hour":13,
"minute":1,
"second":36,
"nano":335000000
}
},
"offset":{
"totalSeconds":0
},
"zone":{
"id":"UTC"
}
}
I need to convert this form of date and time to datetime of the format
"startTime":
"2023-03-31T13:00:00.000Z"
The problem is, I can't do anything before the transformation because this wrong format is coming from an API to which I can't see or change anything. The developers from the API said that the transfomation occured when they processed the data to json. Essentialy I think that what I need is to above date and time to convert from ZonedDateTime to a String?