Alter session to change the time zone : Timezone « SQL PLUS Session Environment « Oracle PL/SQL Tutorial






SQL> create table myTable (
  2  starts  timestamp with local time zone );

Table created.

SQL>
SQL> insert into myTable (starts)
  2  values (TIMESTAMP '2001-12-01 15:00:00.000000 EST');

1 row created.

SQL>
SQL> insert into myTable (starts)
  2  values (TIMESTAMP '2001-12-01 17:00:00.000000 PST');

1 row created.

SQL>
SQL> insert into myTable (starts)
  2  values (TIMESTAMP '2001-12-01 20:00:00.000000 GMT');

1 row created.

SQL>
SQL> alter session set time_zone = '-05:00'
  2
SQL> column starts format a30
SQL>
SQL> select starts from myTable;


STARTS
------------------------------
01-DEC-01 01.00.00.000000 PM
01-DEC-01 06.00.00.000000 PM
01-DEC-01 01.00.00.000000 PM

3 rows selected.

SQL> drop table myTable;

Table dropped.

SQL>
SQL>








29.27.Timezone
29.27.1.Alter session to change the time zone
29.27.2.Determine the database time zone:
29.27.3.Determine your session time zone:
29.27.4.Adjust your session time zone to -08:00
29.27.5.If your session time zone is not US/Central Standard Time (-06:00), alter your session to Central Standard time: