0

I have a primefaces datatable that renders some date values on its columns. This columns are being shown using:

<h:outputText value="#{token.callDate}">
    <f:convertDateTime pattern="dd-MMM-yyyy HH:mm" 
                       timeZone = "America/New_York"/>
</h:outputText>

So, the expected behaviour would be: if i have a date "24-Feb-2016 22:55:00" the rendered value has to be "24-Feb-2016 17:55:00", however the rendered date remains the same "24-Feb-2016 22:55:00".

The Server Time Zone is "America/Mexico_City".

Am I doing something wrong?, is there something missing?, is the 'f:convertDateTime' is not capable of such functionality? Any ideas would be highly appreciated.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
HectorDHC
  • 1
  • 1
  • 1
    The problem is not visible in the information provided so far. The code snippet works perfectly fine for us all when copy'n'pasted'n'executed on a completely blank playground project with everything set to bare defaults and running the latest library/server versions. As an educated guess, may I assume that in your *actual* code you're using something like `timeZone="#{tableRowItem.timeZone}"` and oversimplified it in the question by hardcoding it without actually testing the changed code snippet yourself? If so, then this is a duplicate: http://stackoverflow.com/q/7530560 – BalusC Feb 25 '16 at 09:21
  • Thank you very much for your answer and sorry for not being as clear as possible. The 'timeZone' attribute's value is a Managed Bean property it does not change for every row. This property is being populated on a '@PostConstruct' method. I've also tested the converter by hardcoding the 'timeZone' and it haves the same behaviour. My application is using spring, jsf 2.1 and primefaces an it's running on an Apache Tomcat 8 server. – HectorDHC Feb 25 '16 at 14:10

0 Answers0