Replace Date with ZonedDateTime

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Replace Date with ZonedDateTime

Chris Malan
All my clients are in specific time zones.  They are all deployed to Amazon Web Services.  The default there is UTC.  I can set the time zone to whatever I want to from the command line, but after certain updates, it's back to UTC.

I've done a quick test project using a ZonedDateTime.  It works well. MySQL assigns a tinyblob datatype to it.  My question, why not change dateCreated and lastUpdated to a ZonedDateTime and make the date selectors specify a ZonedDateTime.  In application.yml or application.groovy one can then specify a time zone.  It comes by default with UTC, in case one forgets to set it.  One can even have different users specify their own time zones.

This will make the time zone of the server irrelevant.  One's application will deploy to servers in different time zones and always show the same time zone.  It's very doable.

Hope this is the right forum for this.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/1897f847-1668-4cbe-ba8d-2065b542331a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.