I use JSF1.2 and I have a little problem with time zones.
Calendar respects my timezone and save the correct time in the Database. When I show it using a h:outputtext with a f:convertDateTime it shows the wrong date (I think with default time zone).
I can do something like:
<h:outputText value="#{atividade.atividade.dataCriacao.time}">
<f:convertDateTime pattern="#{msg.formatoDataCalendario2}" timeZone="America/Sao_Paulo" />
</h:outputText>
formatoDataCalendario2 = dd/MM/yyyy, HH:mm in messages.properties.
I can put the time zone in messages too, but I believe it have some configuration that I could use.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…