Create a table with two columns: 'timestamp with time zone', 'c2 timestamp with local time zone' : Timestamp « Date Timezone « Oracle PL / SQL






Create a table with two columns: 'timestamp with time zone', 'c2 timestamp with local time zone'

 
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> --

 








Related examples in the same category

1.TIMESTAMP specifies a precision for the SECONDS field in a TIMESTAMP column (the DATE data type can only store whole seconds).
2.Use the Timestamp data type in a table and insert data
3.Compare data and timestamp
4.INSERT statement adds a row with the TIMESTAMP keyword to supply a datetime literals
5.Use the TIMESTAMP type to define a column in a table
6.TIMESTAMP WITH TIME ZONE type extends TIMESTAMP to allow you to store a time zone
7.TIMESTAMP(4) WITH TIME ZONE
8.Cast string to TIMESTAMP
9.Use TIMESTAMP to mark string in insert statement
10.TIMESTAMP WITH LOCAL TIME ZONE
11.Use timestamp as table column type and insert sysdate to it