Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

af:convertDateTime does not convert timezone

Moh.SayedOct 3 2021 — edited Oct 3 2021

My ADF application reads Date fields from database into oracle.jbo.domain.Date
during the reading from jdbc , timeZone of GMT+3 (timeZone of the vm) is being used
for one of the Fields, I want to display it in different timezone so I defined the required timezone in the af:ConvertDateTime as below. but nothing is happening and the time is displayed in GMT+3 without any change.

this is the definition of my date filed in jsff

        \<af:inputDate value="#{bindings.ActionDate.inputValue}"  
               label="#{bindings.ActionDate.hints.label}"  
               required="#{bindings.ActionDate.hints.mandatory}"  
               columns="#{bindings.ActionDate.hints.displayWidth}"  
               shortDesc="#{bindings.ActionDate.hints.tooltip}" id="id2">  
          \<f:validator binding="#{bindings.ActionDate.validator}"/>  
          \<af:convertDateTime pattern="dd-MM-yyyy HH:mm" timeZone="America/Los\_Angeles"/>  
        \</af:inputDate>  

one more thing, I displayed the same date field in two different displays each with different timezone defined in af:ConvertDateTime, and found that same time is displayed with no change.
timezone is NOT configured in trinidad-config.xml

When I added Z to the pattern to be "dd-MM-yyyy HH:mm Z" I found the timezone name is displayed correctly beside the date, but the time still incorrect.
for example : Date in Database is 28-10-2021 17:30 ( this supposed to be in GMT+3)
this is displayed as 28-10-2021 17:30 (UTC-08:00) Los Angeles - Pacific Time (PT)
So the conversion just change the timeZone name but does not convert the time.

Comments
Post Details
Added on Oct 3 2021
7 comments
397 views