Firstly, it is often useful to present the user with a choice - what time zone he is. You can try to make a conclusion from its settings, but this is unreliable. In grails, you can let the user select their time zone:
<g:timeZoneSelect name="myTimeZone" />
Note that the default value attribute matches the current Locale . So, I would suggest that, by default, the grails localeresolver function will do an excellent job of guessing the user's locale.
To do this, you need to store all the time in the database in UTC (or another time zone, which is fixed for the entire application)
The <g:formatDate> says that it has only 3 attributes, but at least version 1.2 seems to support the timeZone attribute. Therefore, you will need to set timeZone="${currentUser.timeZone}"
source share