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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 136
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: 136
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
 
Similar Threads
Need to specify the time as GMT while creating the date, JVM is on EST
Problems with Calendar and SimpleDateFormat when using UTC time zone
java.sql.ResultSet getTimestamp Locale issue
Converting from GMT to Local Timezone using two seperate fields (date & time).
Convert Local time to UTC and vice versa