how to convert this date format Tue Jan 10 00:00:00 CST 1984 to format 10/01/1984 in jsf?

0

I have my variable DateNacimiento of Type Date to which I pass a date that comes from a WS of type XMLGregorianCalendar

fechaNacimiento = DateUtils.convertXMLCalenarIntoDate(datosProbatorios.getDatosPersonales().getFxNacimiento());

but when you show it on the screen, it goes out in this way Tue Jan 10 00:00:00 CST 1984 and I want it to be this way 10/01/1984, how can I do it?

    
asked by Root93 26.12.2017 в 19:11
source

1 answer

1

Use <f:convertDateTime> . You can nest this in any input and output component. The pattern rules are the same as java.text.SimpleDateFormat .

<h:outputText value="#{someBean.dateField}" >
    <f:convertDateTime pattern="dd-MM-yyyy" />
</h:outputText>
    
answered by 26.12.2017 / 19:18
source