I need to read in some json, sort it, then output it again. I am using this to de-seralise and serialise the json:
private static Gson gson = new GsonBuilder()
.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ")
.create();
If I parse this to a Date:
"activedDate": "2021-04-20T21:48:04.107Z",
Then output it again as Json, I get this:
"activedDate": "2021-04-20T21:48:04.107+0000",
But I need it to have Z instead of +0000 if possible.
Is this possible (without hacking the resultant strings)?
I am forcing my laptop to UTC thusly:
java -Duser.timezone=UTC -jar my.jar