While specifiing the timezone as a string literal works flawless:
<h:outputText value="#{item.dateChange}">
<f:convertDateTime pattern="dd.MM.yyyy HH:mm" timeZone="Europe/Berlin"/>
</h:outputText>
Providing the value by bean doesn't work (Timeoffset 1h to UTC and daylight saving 1h are not applied)
<h:outputText value="#{item.dateChange}">
<f:convertDateTime pattern="dd.MM.yyyy HH:mm" timeZone="#{item.platform.timeZone}"/>
</h:outputText>
I tried both of the methods below none of them works:
public TimeZone getTimeZone() {
return TimeZone.getTimeZone("Europe/Berlin");
}
public String getTimeZone() {
return "Europe/Berlin";
}
I need the timezone to be configurable for a user, how can this be achieved?
EDIT: In order to make sure that the timezone object is available:
<h:outputText value="#{item.platform.timeZone}"/>
sun.util.calendar.ZoneInfo[id="Europe/Berlin",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=143,lastRule=java.util.SimpleTimeZone[id=Europe/Berlin,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]]
or simply: "Europe/Berlin" in the 2nd attempt.