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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content