Grails saves datetime as UTC time, but reads it as local server time?

后端 未结 2 931
长情又很酷
长情又很酷 2020-12-24 08:27

I have the following line in my Grails application to set the default timezone to UTC:

TimeZone.setDefault(TimeZone.getTimeZone(\"UTC\"))

I

2条回答
  •  抹茶落季
    2020-12-24 09:21

    in Bootstrap.groovy

     TimeZone.setDefault(TimeZone.getTimeZone("UTC"))
    

    on JAVA_OPTS.

    -Duser.timezone=UTC
    

    Source : This thread

提交回复
热议问题