0
I have a java web service using Spring Boot, in a class I have a date attribute and I use Jsonformat to format the date and convert on the client side using Gson. However, even defining the locale for the zone of Brazil, which would be UTC-03, it converts to three hours more, making the date different. How to solve this problem?
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy HH:mm:ss", locale = "UTC-03")
private Date date;
I had already tried this approach, but it didn’t work. However, this time it did. I have no idea what might have happened..
– Marcelo Henrique
When I put the application in Tomcat, it continues increasing 3 hours, even with the Timezone set.
– Marcelo Henrique
Marcelo, did you solve it? I have the same problem.
– Alexandre Santos
Oops... using Timezone solved my problem! Thank you!
– Alexandre Santos