pas out

Greenhorn
+ Follow
since Sep 01, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by pas out

Hi Martin,

rpt_end_dt datatype is DATE .

Yes, the UPDATE is done by same application and it is updating the rpt_end_dt column as the same value . But in case of INSERT it is adding 1hr (i.e. MST time+1 Hr).
Thank you, Martin!

There is some issue in view report what is my main intention.

As stated below we are inserting a row when a user is requesting for a report. When a user is coming again to see the status of his/her report we are updating another column in the same row . This time the update query is as below.

UPDATE table_name SET status_cd = 'C', rpt_end_dt = TO_TIMESTAMP_TZ('Tue Feb 12 08:15:03 MST 2013 ','DY MON DD HH24:MI:SS TZD YYYY') WHERE rpt_id = 111

This time the DB is updating with value 2/12/2013 8:15:03 AM for rpt_end_dt .(There is no extra 1hr added to the value)

So every time during insertion extra 1 hr is adding to the DATE field.

Can you help how to resolve this conflict?
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?