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: How to get timezone in 9i

Re: How to get timezone in 9i

From: Stefan Knecht <sk_at_url.org>
Date: Wed, 23 Feb 2005 12:16:27 -0500 (EST)
Message-ID: <20643.194.230.74.40.1109058909.squirrel@able-towers.com>


Hello,

the dbtimezone reflects the actual timezone the database itself has been created with.

the sessiontimezone is your client's current time zone.

they both, if not explicitly set are derived from the operating system by default.

Stef

> On Fri, 18 Feb 2005 16:42:34 +0100, Christian Antognini
> <Christian.Antognini_at_trivadis.com> wrote:
>> >I need to get international time zones in 3 letter format, something
>> like EST,CDT ....etc.
>>
>> ALTER DATABASE SET TIME_ZONE =3D 'EST';
>>
>> Then when you select DBTIMEZONE you get the correct format.
>>
>> Notice that you cannot alter the database if it stores tables with =
>> TIMESTAMP WITH LOCAL TIME ZONE columns.
>> --
> ---------------------------------------------------------------------------
>
> Hi,
>
> I am using Oracle 9.2 on Win2k Pro. Here is a cut and paste of SQL
> PLus:
> ========================================
> 11:43:19 SQL> sho user
> USER is "SYS"
> 11:43:22 SQL>
> 11:43:25 SQL> select dbtimezone from dual;
> more...
>
> DBTIME
> ------
> -07:00
>
> Elapsed: 00:00:00.04
> 11:43:32 SQL> select sessiontimezone from dual;
> more...
>
> SESSIONTIMEZONE
> ---------------------------------------------------------------------------
> -08:00
>
> Elapsed: 00:00:00.03
> 11:43:40 SQL>
> 11:43:41 SQL> ALTER DATABASE SET TIME_ZONE ='EST';
> ALTER DATABASE SET TIME_ZONE ='EST'
> *
> ERROR at line 1:
> ORA-02231: missing or invalid option to ALTER DATABASE
>
> Elapsed: 00:00:00.01
> ==========================================
>
> 1) What is the difference between session time zone and db time zone and
> why is there an hour diference. Also, I am in Eastern Time (which is 5
> hrs behind GMT). Why do I get -7:00 and -8:00 ?
>
> 2) ALTER DATABASE SET TIME_ZONE, does not seem to work.
>
> Thanks.
> --
> http://www.freelists.org/webpage/oracle-l

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Feb 23 2005 - 12:17:46 CST

Original text of this message

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