Skip to Main Content

Java Database Connectivity (JDBC)

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!

Date problem with Ingres EDBC driver

843854Jul 16 2002 — edited Nov 20 2014
Hello. I have seen a lot of posts regarding timezone issues. I am having one with the Ingres EDBC driver returning a timestamp that is 4 hours earlier than the value stored in the database.

i.e. We have a timestamp of July 11, 2002 00:00:37 EDT stored in the database. I understand that the database stores the value internally as GMT. (July 11, 2002 04:00:37 GMT) No problem, right? Well, when the server executes my query, it adjusts the time to the local time zone of the server. It appears that getTimestamp() thinks this is a UTC timestamp. When I try to format, or print it, java adjusts it to my local timezone AGAIN and I get July 10, 2002 20:00:37 EDT.

CA's tech support insists that this behavior is correct.

They are telling me that it's my application's responsibility to adjust the time based on the server's timezone. I don't know how an application running on separate machine can know the local timezone of the database server... :-)

Shouldn't it be their driver's responsibility to return a value in UTC that java can deal with properly?

I realize that I can put a hack in to change the timezone to GMT, or add 4 hours to all the times but that will break the code if I switch to another driver/database.

I would appreciate any help.

-Vic
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 27 2008
Added on Jul 16 2002
3 comments
180 views