0

I trying to return date like that " 9/10/2013 " only without time or naming dayes

but when I use

<p:calendar  value="#{studentQuery.from}" pattern="MM/dd/yyyy" navigator="true" display="inline"/>  

it return :

Thu Sep 12 00:00:00 EET 2013 

how to fix that to return date only like : " 9/10/2013 " using primefaces 3.5 with jsf 2

4

1 回答 1

0

在 Java 中:

 SimpleDateFormat format = 
        new SimpleDateFormat("MM/dd/yyyy");

 System.out.print(format.format(dateObject));

在 JSF 中:

<h:outputText value="#{bean.date}">  
            <f:convertDateTime pattern="MM/dd/yyyy"/>  
        </h:outputText>  

大致是这样的。

于 2013-09-09T08:15:34.343 回答