Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Universal date/time in Oracle and JDBC

Re: Universal date/time in Oracle and JDBC

From: C. Ferguson <c_ferguson_at_rationalconcepts.com>
Date: Fri, 01 Jun 2001 19:12:06 GMT
Message-ID: <3B17E932.98CAE938@rationalconcepts.com>

Hi Kevin,

    store the the UTC date as a long in the database. Then when the java client pulls the date (specified as long), take it and throw it into a java.util.Date type. The java client will then use the client time-zone to interpret the the date correctly.

hth,
cindy

Kevin Dean wrote:

> I am developing an application that has to span multiple time zones. In
> order to facilitate this, the clock on the database server is set to UTC.
> The problem I am having is that Oracle or its JDBC driver don't seem to
> understand this idea of spanning multiple time zones:
>
> 1) I enter a date/time in Eastern Daylight Time as today at 13:30; I would
> like the database to store it as today at 19:30 (UTC = EDT + 4).
> 2) Another application in Central Daylight Time retrieves the record; I
> would like that application to see the date/time as today at 12:30.
>
> The problem I'm having is that Oracle stores the date/time based on the time
> zone in which the date was entered; i.e. no matter what machine I go to the
> JDBC driver returns the date/time as today at 13:30.
>
> Is there any way to tell the JDBC driver that all dates are UTC? I really
> don't want to have to write wrappers around all my date selects, inserts,
> and updates. Any help would be greatly appreciated.
>
> --
> Remove NOSPAM woven into e-mail address to reply directly.
Received on Fri Jun 01 2001 - 14:12:06 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US