Timezone effects on Date and Timestamp fields in af:query component

Hello,
I'm working on an ADF application where time zone is configured as follows:
* Dynamic View Layer time zone is configured in trinidad-config.xml file and bound to a session scoped value:
<trinidad-config>
  <skin-family>fusionFx</skin-family>
  <time-zone>#{sessionScope.tz}</time-zone>
</trinidad-config>* ADF BC time zone is configured in adf-config.xml file and bound to View Layer time zone:
<adf-config>
  <user-time-zone-config xmlns="http://xmlns.oracle.com/adf/usertimezone/config">
    <user-timezone expression="#{adfFacesContext.timeZone.ID}"/>
  </user-time-zone-config>
</adf-config>The problem here is that Dates and Timestamp values work as expected all over the application except for the af:query component. When displayed as af:inputDate in af:form, Dates and Timestamp values are NOT getting converted to the time zone (TZ) configured in trinidad-config.xml file, whereas TimestampTz and TimestampLtz are. However, when displayed in af:query component, Dates and Timestamp values are automatically converted to View Layer TZ after a search has been performed.
For example, say View Layer TZ = US/Pacific and we enter 01/jun/2011 as a search criteria of type Date and then click on the Search button. The displayed value automatically changes to 25/nov/2011, that is, it gets converted to the WLS JVM time zone, which is set to Europe/London.
Is conversion of Date and Timestamps in af:query component the expected behaviour or could this be a bug?
Is there any way to avoid this conversion?
Thanks in advance
Version:
ADF Business Components 11.1.1.59.23
Java(TM) Platform 1.6.0_21
Oracle IDE 11.1.1.4.37.59.23
PMD JDeveloper Extension 4.2.5.3.0
Repost on 26-nov-2011 9:29
Repost on 28-nov-2011 15:10
Edited by: Barbara Gelabert on 26-nov-2011 9:29
Edited by: Barbara Gelabert on 28-nov-2011 15:10

Hi,
Thanks for your reply. This certainly seems promising. However, I am getting a connection error now.
The following...
jar_loaded = require 'ojdbc14.jar'
puts "Oracle jar loaded? #{jar_loaded}"
puts "Starting active record"
require 'rubygems'
gem 'activerecord'
gem 'activerecord-oracle_enhanced-adapter'
require 'activerecord'
puts "Connecting to MXGN"
ActiveRecord::Base.establish_connection(
:adapter => 'oracle_enhanced',
:host => 'THEHOST',
:port => '1550',
:database => 'THEDB',
:username => 'THEUSER',
:password => 'THEPASSWORD'
... produces
Oracle jar loaded? true
Starting active record
Connecting to MXGN
ERROR: ActiveRecord oracle_enhanced adapter could not load Oracle JDBC driver. Please install ojdbc14.jar library.
ERROR: ActiveRecord oracle_enhanced adapter could not load Oracle JDBC driver. Please install ojdbc14.jar library.
C:/jruby/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:76:in `establish_connection': Please install the oracle_enhanced adapter: `gem install activerecord-oracle_enhanced-adapter` (LoadError) (RuntimeError)
from H:\sandbox\DBPlay\lib\main_enhanced.rb:12
I'm confused. Am I missing the driver, or have I failed to setup the enhanced Oracle adapter?
I have tried moving the jar to $JRUBY_HOME/lib too, but the result was the same.
All help would be greatly appreciated.
Many Thanks
Adrian

Similar Messages

  • Getting current date and timestamp for timezone

    I am getting the current date and timestamp using
    Date d = new Date();
    On the platform I'm using it is returning it in GMT time.
    I want to convert this into Eastern Time Zone for United Status.

    java.util.Date objects contain a count of milliseconds since the "epoch", which happens to be midnight, Jan 1 1970 GMT. However, they aren't intrinsically "in" any timezone.
    If you simply call Date.toString(), you'll get the date formatted for the current locale, including timezone.
    If you want a different format, you can use the DateFormat or SimpleDateFormat classes (recommended), or use Calendar to pull the various date components out. You have to physically set the timezone for each of these.
    To get a list of timezones supported by your machine, you can run this program:
    import java.util.Arrays;
    import java.util.TimeZone;
    public class TZDump
        public static void main(String[] argv)
        throws Exception
            String[] zones = TimeZone.getAvailableIDs();
            Arrays.sort(zones);
            for (int ii = 0 ; ii < zones.length ; ii++)
                System.out.println(zones[ii]);
    }And, here's a program that lets you compare the same date in different timezones:
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.TimeZone;
    public class TZDemo
        public static void main(String[] argv)
        throws Exception
            SimpleDateFormat fmt = new SimpleDateFormat("MM/dd/yy HH:mm:ss");
            Date now = new Date();
            System.out.println("Default TZ = " + fmt.format(now));
            String[] zones = new String[] { "EST", "EST5EDT", "PST"};
            for (int ii = 0 ; ii < zones.length ; ii++)
                fmt.setTimeZone(TimeZone.getTimeZone(zones[ii]));
                System.out.println("EST        = " + fmt.format(now));
    }

  • How to validate date and timestamp format? Please help!

    Hi experts,
       I have a input field "receipt_date" with is of char20 type. It contains date and timestamp value like 20090429T054509.000Z
       In my ABAP code I want to validate if "receipt_date" value is in the format YYYYMMDDTHHMMSS.MMMZ. If not then display error message. How can do this validation? Is there any existing function module that does this kind of validation? Please help!
    Thanks & Regards
    Gopal

    Hi Gopal,
    Can you check whether the FM CACS_TIMESTAMP_GET_DATE is available in XApps? If yes, use this to identify a valid timestamp.
    Sample code:
        CALL FUNCTION 'CACS_TIMESTAMP_GET_DATE'
          EXPORTING
            i_timestamp = lv_stamp
          IMPORTING
            e_date      = lv_datum
            e_time      = lv_time.
    Hope this helps! Do let me know if you need anything else!!
    Cheers,
    Shailesh.
    Always provide feedback for helpful answers

  • Date and timestamp code

    Hi Experts,
    I've a table which contains date and timestamp in single field. Now I need to do look up on this table.
    But this table can contain multiple records on same day.  I need to take record which has lower data and timestamp. How can I write a code to select lower date and stamp if multiple records exists. Any sample code. advance thank you very much.

    data: begin of itab occurs 0,
              date like sy-datum.
              end if itab.
    data: timestamp(14),
             zdate like sy-datum.
    select time from "ur table name"  into ztimestamp.
         zdate = ztimestamp(8).
    append ztable to itab.
    endselect.
    sort itab ascending.
    read table itab index 1.
    write:/ itab-date "it would be ur lowest date

  • Reading Dates and Timestamps created by PL/SQL

    Hello,
    This is probably a FAQ (or stating the obvious) but I want to make sure I've got the right idea about things...
    I recently noticed that our Java app reads dates/timestamps incorrectly from the database. Any date set using 'SYSDATE' in PL/SQL is an hour out when read by Java. This is because we are now in BST and the object read back by the JDBC driver thinks the timezone is GMT.
    From reading around it seems that the DATE and TIMESTAMP types in Oracle don't persist timezone information. Fair enough, but to me this makes it dangerous to use SYSDATE at all in PL/SQL procedures.
    Previously I've never relied on the database itself to generate timestamps so dates have always been stored as UTC. I'm currently using SYS_EXTRACT_UTC(SYSTIMESTAMP) when inserting data in to tables and basically wondering if this is the common way of achieving accuracy.
    (using types such as "TIMESTAMP WITH LOCAL TIME ZONE" seem to have their own annoyances in JDBC so I've opted to avoid those)
    Thanks.

    Tom,
    This may be helpful...
    http://www.javaworld.com/javaworld/jw-10-2003/jw-1003-time.html
    Good Luck,
    Avi.

  • MS Word Web Service Interface: bad format of date and currency fields

    Hi,
    I am using MS Word Web Service interface to create contract documents. However, my date and currency fields show in a strange format. Date is in"YYYY-MM-DD" format, while currencies always have "." as decimal separator (probably technical values). My user settings are "DD.MM.YYYY" for dates and "n.nnn,dd" for decimal numbers.
    My workaround is to create a Z structure for WS interface with char fields and then do conversion through CRM_WST_RT_BADI->OUTBOUND_PROCESSING method. This works, but requires a lot of custom development.
    Is there a way to "tell" the interface to use correct formats in MS Word without doing it all manually through custom fields?
    Thanks!
    KR,
    Igor

    Oh, indeed!
    We might be closer than you think - I live close to Croatian-Slovenian border so we might pop out for a drink! But we can discuss this out of forum... 
    Now work again:
    Is there any documentation on possible formatting keywords? I suppose it's possible to set up decimal places, custom date formats etc.
    Cheers,
    Igor

  • Color coding in the "Date" and "Time" field in "Person Assignment"

    Hi,
    What does it mean when the color of the values for the "Date" and "Time" fields under the tab "Person Assignment" on an activity element in the project builder (CJ20N) turn red?
    Regards,
    Petter Kvalvik

    Hi,
    I dont suppose we have any option to achieve this at Query Designer level. Your requirement can be achieved in Workbook,
    Insert text template in one of the cell in your workbook, context menu--properties-Constant Tab----Check Display last Refreshed. Doing this you will get Date and Time of last refreshed data.
    Thanks,
    Vishnu.

  • Production Order Change Date and Timestamp

    Hi, While trying to change the quantity and date of a production order I want to capture the date and timestamp of the change time.
    Please let me know which table or function module can be used for this. Thanks.

    Check AUFK-->AEDAT
    Regards
    AM

  • To implement search help for date and time fields details

    how can i implement search help for date and time fields in screen painter

    Hi
    Declare the variables as sy-datum and sy-uzeit or any other pre-defined data typ of date and ime types. Serach help will automatically comes.
    Aditya

  • How to compare table data and table field

    Hi buddy,
        I have some question about how to compare table data and table field.
       1. I know there is one method:   CL_ABAP_UNIT_ASSERT=>ASSERT_TABLE_CONTAINS  , it use in unit test to compare the table data(A and B) , you can loop table A into structure A1, then use this mehtod it can compare whether table B contain structure A1.  but when I try to use this in main program it will dump.
              CL_ABAP_UNIT_ASSERT=>ASSERT_TABLE_CONTAINS(
                                                                                                        LINE    = A1
                                                                                                        TABLE = B ).
           Is there any method or FM can be used to compare the table data ?
        2. I also want to compare two table field , try to find out the different. How to realize this.
    Thank you for your sincerely answer.

    Hi Zongjie,
    What`s the difference, if you using loop A into wa_A, read table B into wa_B with all field, then compare with wa_A and wa_B.
    The question 2, seems no standard FM available here.
    Loop A into wa_A.
       Loop B into wa_B.
           if wa_A-field1 eq wa_B-field1.
           endif.
            if wa_A-field2 eq wa_B-field2. 
           endif.
       endloop.
    endloop.
    regards,
    Archer

  • Reportable Last Modified Date and Time Field

    Reportable Last Modified Date and Time Field
    Hello,
      We need a reportable RequestCenter 'last modified date/time' database field that is refreshed when the 'Comments and History' field is updated.  Any ideas would be appreciated.  Thanks! 

    No, unless you can use an FTP client.

  • Date and Timestamp not updating

    Following on from my previous posts, the date and timestamp of updated files are not being updated in RoboSource Control, i.e. the Modified column in the RoboSource Control Explorer. However, it looks like changes are being stored on the server when topics are checked in, as I can right-click a file in source control that I have changed, choose View, and see the amendments in the HTML.
    Basically, this means that source control isn't recognising that files have changed and therefore when someone tries to get the latest version it doesn’t think there is one because the date and time are the same as previous version.
    Has anyone experienced this behaviour before or know why the Modified column has suddenly stopped being updated?
    Thanks
    Jonathan

    After some digging and random Googling the following article seems to have fixed my issue .
    It seems that if you are running RoboSource Control on 64-bit machines, there are problems with checking in files.
    http://helpx.adobe.com/robohelp/kb/cant-check-files-robosource-control.html.

  • When LAST_DDL_TIME and TIMESTAMP fields are uptaded?

    Hi,
    I need know when the fields LAST_DDL_TIME and TIMESTAMP are updated.
    - Which updated objects (tables, procedures, etc) can change them?
    - Which references are updated too? All?
    Thanks by any help
    Moises Rodrigues
    System Analist
    CPM Braxis - http://www.cpmbraxis.com

    Hi,
    Please refrain from posting duplicate threads.
    Already answered Re: When LAST_DDL_TIME and TIMESTAMP fields are uptaded?
    Aman....

  • DATE and TIMESTAMP problem - fixable with 11.1 JDBC Driver?

    I'm adding some queries to an older part of our code base and while reading through the documentation for one of the classes I found that we weren't using our normal Hibernate queries because we needed to ensure that we weren't sending Timestamps to Oracle. Apparently the Timestamp would be converted to a Date because the column in the database was of type DATE. This was causing problems because the DATE column's index was being ignored and the table contains millions of records.
    The Oracle FAQ seems to indicate that this has been fixed in the 11.1 JDBC drivers. I know that I can use 11.1 JDBC drivers with a 10.2.0 database, but will it use the new 11.1 mappings for DATE and TIMESTAMP or the old 10.2.0 mappings? Oracle FAQ page: http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#08_01

    Oracle FAQ page: http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#08_01
    Well obviously that was really stupid.
    I'm adding some queries to an older part of our code base and while reading through the documentation for one of the classes I found that we weren't using our normal Hibernate queries because we needed to ensure that we weren't sending Timestamps to Oracle. Apparently the Timestamp would be converted to a Date because the column in the database was of type DATE. This was causing problems because the DATE column's index was being ignored and the table contains millions of records.
    Not sure I follow that logic.
    If the value was going into the database then it would update the index.
    From that only one of the following could be true.
    1. It wasn't going into the database.
    2. It was being truncated to a date.
    The Oracle FAQ seems to indicate that this has been fixed in the 11.1 JDBC drivers. I know that I can use 11.1 JDBC drivers with a 10.2.0 database, but will it use the new 11.1 mappings for DATE and TIMESTAMP or the old 10.2.0 mappings? I would agree with your interpretation of the FAQ.
    And I would then follow it up by testing both with the old driver and the new.

  • Addition of checkbox and 2 fields in ABap query selection screen

    Hi
    I need to add chack boxes and 2 fields in ABAP query which is using LDB QMI. can u pls let me know how to do that.

    Hi Tarun,
    I am still not clear with the problem..I guess you require plant in your selection screen which you have.
    i guess if you go to sq01tcode there is a option infoset query from where you can give your selection options and value.
    have you selected all the fields in infoset and made a selection screen?
    When you have done with your infoset you just need to diplay the fields and there is a automatic program generated.
    Let me know...
    Regards,
    Nihkil.

Maybe you are looking for