Reputation: 185
I have a Grails 2.5.6 app developed with Java 1.8 running in a Docker container. While app was in development I defined time zone in Bootstrap.groovy
as follows:
TimeZone.setDefault(TimeZone.getTimeZone("America/La_Paz"))
This is the problem: I select a date in my form, let's say 11/05/2021. Then I checked in the database that the date was saved as 2021-05-11 00:00:00
, which is correct. But the show view shows date as 10/05/2021. Date is even retrieved as 10/05/2021 when I call the edit form. So, if I update the record, date is saved as 10/05/2021.
What could be wrong?
PD: I'm using Audit Logging too, could it be the cause?
Upvotes: 0
Views: 65
Reputation: 185
Running the docker container with the following line solved the problem:
docker run -d -e JAVA_OPTS='-Duser.timezone=America/La_Paz' -p 8091:8080 mycontainer
Sending the JAVA_OPTS parameter did the trick.
Upvotes: 1