aspose file tools*
The moose likes JDBC and the fly likes Timezone getting Oracle date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Timezone getting Oracle date" Watch "Timezone getting Oracle date" New topic
Author

Timezone getting Oracle date

Yan Zhou
Ranch Hand

Joined: Sep 02, 2003
Posts: 137
Hi,

I am using Oracle Thin driver on a table with a DATE column.

There are existing rows in the tables, their values are in UTC time zone, which may be different from the internal time zone of Oracle DB.



What I wanted to do is to retrieve the date as in UTC time zone (regardless of DB timezone), I am expecting sdf.format() returns the exact time as in DB since it is already UTC. However, in reality, sdf.format() applies the time zone difference for a second time.

I wonder whether getTimestamp() returns time stmap using Oracle's internal timezone?

What am I missing here?
Thanks.
Yan
Yan Zhou
Ranch Hand

Joined: Sep 02, 2003
Posts: 137
If I call getTimestamp() on a Oracle DATE column, what timezone info. is in the returned Date object?

Date object contains the number of milliseconds since 1970/1/1 GMT, which is the starting point, what is the end point? Say, Date column has 1990/1/1, is the end point 1990/1/1 in Oracle's default time zone?

Thanks.
Yan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Timezone getting Oracle date