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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Time conversion problems (time math)

Re: Time conversion problems (time math)

From: Peter Sylvester <peters_at_mitre.org>
Date: Thu, 25 May 2006 11:00:46 -0400
Message-ID: <4475C69E.8090804@mitre.org>


Bill,

I don't have the definitive answer to your problem, but have a couple of thoughts which might help you out. I have recently been using "timestamp" data types in 10.2, although without the timezone qualifier, and have found that they are much more limited than "date" types, in terms of functions that may be applied, and doing math operations.

I did notice that if you perform a select and add zero (0) to a timestamp field, it seems to get coerced into a date type, which you can then manipulate a lot easier. I'm not sure what happens to sub-second and timezone components when you do this, however. This behavior does not seem to be specifically documented.

Another approach, is to write a Java stored procedure which can retrieve the timestamp value, convert it to UTC milliseconds, do whatever math things need to be done and convert it to a new timestamp value, using whatever timezone you like. I have not tried this as a JSP, but have done similar things using client side Java code, so it should be possible.

--Peter

--

http://www.freelists.org/webpage/oracle-l Received on Thu May 25 2006 - 10:00:46 CDT

Original text of this message

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