In a web application the user can choose the timezone which is passed to the timezone
attribute of the calendar widget:
<p:calendar value="#{curValue}" timeZone="#{settingsBL.getTimeZoneIdSet()}" />
The delivered date in the backing bean is converted to the timezone of the server (JBoss in my case with CEST). The backend want the date and time as always as UTC (and delivers it in UTC).
So when I store a date I have to convert the CEST date to UTC and save it. If a date is delivered from backend it is UTC. I have to convert it to the system default (JBoss with CEST) and the calendar will take care that it is displayed correctly on the client.
Is this correct? I am a little bit confused about that. The server timezone is variable and cannot be set hard to UTC or something.
The date from the client is always converted to CEST for my example. Regardless what I set to javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE
in web.xml.
I am using primefaces 5.2.13 and Mojarra 2.2.12 with JBoss 6.4