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

Home -> Community -> Usenet -> c.d.o.misc -> Help with DATE conversion based on sessiontimezone, dbtimezone

Help with DATE conversion based on sessiontimezone, dbtimezone

From: marty <marty436_at_yahoo.com>
Date: 28 Apr 2006 11:18:06 -0700
Message-ID: <1146248286.196065.247630@u72g2000cwu.googlegroups.com>


I would like to convert a date value in a select statement to the session timezone. I know I can use NEW_TIME with the timezone abbreviations, but dbtimezone and sessiontimezone returns offsets (-05:00 for CST etc). not timezone abbreviations. Since I want to adjust the date by the interval
between dbtimezone and sessiontimezone, Iwas thinking something like:

select new_time(old_date,
decode(dbtimezone,'-04:00','EST','-05:00','CST','-06:00','MST','-07:00','PST','-08:00','YST'), decode(sessiontimezone,'-04:00','EST','-05:00','CST','-06:00','MST','-07:00','PST','-08:00','YST'))

but this doesn't seem very elegant, and I don't think very efficient for a large number of records. Any suggestions? Received on Fri Apr 28 2006 - 13:18:06 CDT

Original text of this message

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