3

We have a Grails 2.1.0 project and our staging and production dbs are on shared db servers.

We would like to set the timezone to UTC (0) on a per connection basis, is there an easy way to do this from the DataSource.groovy file.

Other suggestions also welcome.

chim
  • 8,407
  • 3
  • 52
  • 60
  • Have you checked http://stackoverflow.com/questions/7605953/how-to-change-mysql-timezone-in-java-connection ? – Tomo Aug 25 '12 at 10:06

1 Answers1

2

Jared's answer to grails/mysql timezone change suggests that we don't need to adjust the mysql timezone at all, as the datetime fields are stored as MySql DateTime. I solved this for my local machine by adding -Duser.timezone=UTC to $JAVA_OPTS, so this may be the required solution.

We've tried this across local and stage environments and this does solve the issue.

Community
  • 1
  • 1
chim
  • 8,407
  • 3
  • 52
  • 60