How to format the date and time on a JSF page when rendering a Date object?

Solution Verified - Updated -

Issue

  • How to format the date and time on a JSF page when rendering a Date object?

Example:

<h:column>
 <f:facet name="header">Prize Given Date</f:facet>
 <div align="center"><h:outputLabel
 value="#{row.prizeGivenDate}" /></div>
 </h:column>

prizeGivenDate is java.sql.Timestamp, but displays as "02/04/2011". Is it possible to make it display as "02/04/2011 HH:mm:ss"?

Environment

  • JBoss Enterprise Application Platform (EAP) 4.3.0.GA_CP08

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.