Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: How to arrive at PST or PDT for a date?
Govindan,
I don't do well with timezone functions myself .. but here is a stab at your question:
ORA92> select sessiontimezone from dual;
SESSIONTIMEZONE
ORA92> select dbtimezone from dual;
DBTIME
ORA92> select cast(sysdate as timestamp) from dual;
CAST(SYSDATEASTIMESTAMP)
FROM_TZ(CAST(SYSDATEASTIMESTAMP),SESSIONTIMEZONE)
ORA92> select from_tz(cast(sysdate as timestamp), 'US/Eastern') from dual;
FROM_TZ(CAST(SYSDATEASTIMESTAM
ORA92> select to_char(from_tz(cast(sysdate as timestamp), 'US/Eastern'),'TZD') from dual;
TO_CHAR(FROM_TZ(CAST(SYSDATEAS
ORA92> select to_char(from_tz(cast(sysdate - 10 as timestamp), 'US/Eastern'),'TZD') from dual;
TO_CHAR(FROM_TZ(CAST(SYSDATE-1
EXTRACT(TI
ORA92> alter session set time_zone='US/Eastern';
Session altered.
ORA92> select from_tz(cast(sysdate as timestamp), sessiontimezone) from dual;
FROM_TZ(CAST(SYSDATEASTIMESTAMP),SESSIONTIMEZONE)
ORA92> select extract(timezone_abbr from from_tz(cast(sysdate as timestamp), sessiontimezone)) from dual;
EXTRACT(TI
Anurag
On 3/12/07, Govindan K. <gkatteri_at_inbox.lv> wrote:
> > > Hello > > This is on 9iRel2 Solaris. > > I have a date value. But i would need to find out if the date belongs to > PST or PDT. PDT if between 11-mar / nov 4th; I donot want to hardcode ; I > prefer to use some Timezone function which i can rely on for future updates > if any. > > SQL>column sessiontimezone format A10 wrap; > SQL>select change_id_ , create_date > 2 , cdate(create_date) > 3 , sessiontimezone > 4 , TO_CHAR(cdate(create_date), 'DD-MON-YYYY HH24:MI:SS') to_charr > 5 from chg_change where change_id_ like '%3261%' > 6 / > > CHANGE_ID_ CREATE_DATE CDATE(CREATE_DATE) SESSIONTIM TO_CHARR > --------------- ----------- -------------------- ---------- > -------------------- > CHG000000003261 1033750736 04-OCT-2002 09:58:56 -07:00 04-OCT-2002 > 09:58:56 > CHG000000013261 1081461511 08-APR-2004 14:58:31 -07:00 08-APR-2004 > 14:58:31 > CHG000000023261 1129660641 18-OCT-2005 11:37:21 -07:00 18-OCT-2005 > 11:37:21 > CHG000000032610 1172769011 01-MAR-2007 10:10:11 -07:00 01-MAR-2007 > 10:10:11 > CHG000000032611 1172769657 01-MAR-2007 10:20:57 -07:00 01-MAR-2007 > 10:20:57 > CHG000000032612 1172770327 01-MAR-2007 10:32:07 -07:00 01-MAR-2007 > 10:32:07 > CHG000000032614 1172772261 01-MAR-2007 11:04:21 -07:00 01-MAR-2007 > 11:04:21 > CHG000000032615 1172772456 01-MAR-2007 11:07:36 -07:00 01-MAR-2007 > 11:07:36 > CHG000000032616 1172772877 01-MAR-2007 11:14:37 -07:00 01-MAR-2007 > 11:14:37 > CHG000000032617 1172773199 01-MAR-2007 11:19:59 -07:00 01-MAR-2007 > 11:19:59 > CHG000000032619 1172777265 01-MAR-2007 12:27:45 -07:00 01-MAR-2007 > 12:27:45 > CHG000000032618 1172776231 01-MAR-2007 12:10:31 -07:00 01-MAR-2007 > 12:10:31 > CHG000000032613 1172771579 01-MAR-2007 10:52:59 -07:00 01-MAR-2007 > 10:52:59 > > 13 rows selected. > > SQL> > > In other words i wound need to know if a date falls outside DayLight > Savings. I would appreciate any help. > > Thanks > Govindan > > > > > __________ > Advertisement: > - Inbox.lv – bezmaksas 2.5 GB (2500 MB) liela pastkastite > - Anti-Virus un Anti-Spam aizsardziba > - REGISTRACIJA > <http://ads.inbox.lv/htmlclick.php?bannerID=6168&dest=http%3A%2F%2Fwww.inbox.lv%2Fhorde%2Fimp%2Fsignup.php%3Flanguage%3Dlv_LV> > [image: www.inbox.lv] > <http://ads.inbox.lv/htmlclick.php?bannerID=6168&dest=http%3A%2F%2Fwww.inbox.lv> >
-- Anurag Varma -- http://www.freelists.org/webpage/oracle-lReceived on Mon Mar 12 2007 - 20:45:59 CDT
![]() |
![]() |