Hi,
I have an application running in Weblogic(10.0) on linux server. The server is in MST.
The database is Oracle (10g) . The server is in CST.
Here is my code which is inserting the data into Oracle DB.
String MSTTime = null;
Calendar currentdate = Calendar.getInstance();
DateFormat formatter = new SimpleDateFormat(
"EEE MMM dd HH:mm:ss z yyyy");
TimeZone obj = TimeZone.getTimeZone("MST");
formatter.setTimeZone(obj);
MSTTime = formatter.format(currentdate.getTime());
The SQL query is (This value is from my log)
INSERT INTO table_name (rpt_id, rpt_rqstd_dt )
VALUES (111, TO_TIMESTAMP_TZ('Tue Feb 12 06:37:03 MST 2013','DY MON DD HH24:MI:SS TZD YYYY'))
The date value column in database is inserted with value 2/12/2013 7:37:03 AM (Extra 1 hr). This is happening when application is trying to insert a record in Database. If i am running this query manually in the DB it is inserting as 2/12/2013 6:37:03 AM.
The datatype of rpt_rqstd_dt is DATE in oracle DB.
To sink up some view report issue we want to store date in one timezone format(either CST or MST, here we have choose MST) .Can someone help how to fix this issue?