Java Mailing List Archive

http://www.dba.5341.com/

Home » Home (12/2007) » oracle l »

Re: Time conversion problems (time math)

Peter Sylvester

2006-05-25


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


©2008 dba.5341.com - Jax Systems, LLC, U.S.A.