Mega Code Archive

 
Categories / Oracle PLSQL / Date Timezone
 

Create a table with two columns

SQL> SQL> SQL> create table t   2  (c1 timestamp with time zone,   3   c2 timestamp with local time zone)   4  / Table created. SQL> SQL> insert into t (c1,c2)values( current_timestamp, current_timestamp ); 1 row created. SQL> SQL> select * from t; C1 --------------------------------------------------------------------------- C2 --------------------------------------------------------------------------- 16-JUN-08 07.01.25.376000 PM -06:00 16-JUN-08 07.01.25.376000 PM 1 row selected. SQL> SQL> alter session set time_zone = '-08:00'; Session altered. SQL> SQL> select * from t; C1 --------------------------------------------------------------------------- C2 --------------------------------------------------------------------------- 16-JUN-08 07.01.25.376000 PM -06:00 16-JUN-08 05.01.25.376000 PM 1 row selected. SQL> SQL> drop table t; Table dropped. SQL> SQL> --