Calender.getTime is displaying wrong date(One day earlier then the current)
I am trying to display date from a calender object. My code is
<h:outputText value="#{documentActivity.createdDate.time}" />
createdDate is a calender object.
this output is wrong, if the date is 05/28/07, this displays as 05/27/07.
When I try to print the same from a java class it prints fine...
createdDate.getTime().
Has anyone faced this issue, Is there a problem with the JSF tag?
# 2
[nobr]Which JSF version? Do you use a converter?
I can't reproduce it here in 1.2_04 with the following basic snippets:<h:outputText value="#{myBean.date}" /><br>
<h:outputText value="#{myBean.calendar.time}" /><br>
<h:outputText value="#{myBean.date}"><f:convertDateTime/></h:outputText><br>
<h:outputText value="#{myBean.calendar.time}"><f:convertDateTime/></h:outputText><br>
MyBeanpublic Date getDate() {
return new Date();
}
public Calendar getCalendar() {
return Calendar.getInstance();
}
It all shows valid dates.[/nobr]