0

I am using weblogic server and oracle as a backend for my j2ee application.

we have multiple columns with data type as TIMESTAMP(6) WITH LOCAL TIME ZONE along with other column data type as TIMESTAMP(6). issue is though values are same for each column 1hr extra displayed in UI. In UI we simply doing SimpleDateFormat using java.

DB values are for all three column are 23-SEP-15 03.37.52.958000000 PM

But IN UI it is displayed as for TIMESTAMP(6) WITH LOCAL TIME ZONE fields 23-SEP-15 04.37.52.958000000 PM

Server it is showing correct time zone.any Idea what it went wrong.

Java code displaying dateFiled

SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
.........................
.............................
....some code goes here..........
..getting the values from DB and converting it to value Objects... 

String dateValue = sdf.format(valueBO.getDateValue()).toString();
.....
 Just given lines of code how i am converting the DB value
...........

On page it displays 23-Sep-15 03.37.52.938 PM

+update any issue with DBTIMEZONE.

user1268890
  • 173
  • 2
  • 4
  • 20
  • What is the timezone of the current session? What is the result of `SELECT TO_CHAR(SYSTIMESTAMP, 'TZR') FROM dual` – Wernfried Domscheit Sep 23 '15 at 10:35
  • SQL> SELECT SYSTIMESTAMP, CURRENT_TIMESTAMP, LOCALTIMESTAMP FROM dual; SYSTIMESTAMP --------------------------------------------------------------------------- CURRENT_TIMESTAMP --------------------------------------------------------------------------- LOCALTIMESTAMP --------------------------------------------------------------------------- 23-SEP-15 04.13.08.736000 PM +05:30 23-SEP-15 04.13.08.736000 PM +05:30 23-SEP-15 04.13.08.736000 PM any issues with DBTIMEZONE? – user1268890 Sep 23 '15 at 10:49
  • Please share the Java code you use for displaying the time stamp. – Mick Mnemonic Sep 23 '15 at 11:50
  • What time zone do the `with local time zone` columns show, and what is the DBTIMEZONE? Suspect the values are in a different zone (1 hour out) and the Java query is converting them. Please show the queries and related Java code. (Edit the question to show more info, including the query you put as a comment earlier; it's not easy to read code in comments) – Alex Poole Sep 23 '15 at 12:05
  • it is working perfect in my local server but not working at client test environment at node level. – user1268890 Sep 23 '15 at 12:12
  • Please post everything that's relevant, i.e. what does `valueBO.getDateValue()` refer to? – Mick Mnemonic Sep 23 '15 at 12:15
  • Regarding `DBTIMEZONE` have a look at this post: [How to handle Day Light Saving in Oracle database](http://stackoverflow.com/questions/29271224/how-to-handle-day-light-saving-in-oracle-database/29272926#29272926) – Wernfried Domscheit Sep 23 '15 at 12:28
  • @user1268890, I did not asked for `SYSTIMESTAMP, CURRENT_TIMESTAMP, LOCALTIMESTAMP`, I asked for `TO_CHAR(SYSTIMESTAMP, 'TZR')` and `SESSIONTIMEZONE`! That is different. – Wernfried Domscheit Sep 23 '15 at 12:34
  • TO_CHAR(SYSTIMESTAMP,'TZR') -------------------------------- +05:30 – user1268890 Sep 23 '15 at 12:52

0 Answers0