Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

<f:convertDateTime pattern="dd.MM.yyyy HH:mm:ss" /> bug?

843842Apr 29 2006 — edited Jul 13 2008
Hello,

i have a bean method that returns a date object to the jsp page.
	public Date getTestDate() {
		System.out.println("returning current login date: "
				+user.getLastSuccessfulLogin().getLoginDate());
		return user.getLastSuccessfulLogin().getLoginDate();
	}
the output of this method is:
returning current login date: Sun Apr 30 03:57:35CEST 2006

now the jsp side
				testdate jstl: 
				<fmt:formatDate value="${memberDisplayBean.testDate}" pattern="dd.MM.yyyy HH:mm:ss" />
				<br />
				testdate jsf:
				<h:outputText value="#{memberDisplayBean.testDate}">
					<f:convertDateTime pattern="dd.MM.yyyy HH:mm:ss" />
				</h:outputText>
the output is :

testdate jstl: 30.04.2006 03:57:35
testdate jsf: 30.04.2006 01:57:35

while jstl works fine , jsf makes problem and substracts 2 hours.
Why is it behaving this way.

annotation why is
				<h:outputText value="#{memberDisplayBean.testDate}">
					<f:convertDateTime pattern="dd.MM.yyyy HH:mm:ss" locale="de"/>
				</h:outputText>
coursing an error , "de" is a valid language code
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 10 2008
Added on Apr 29 2006
3 comments
3,405 views