Using the TIMESTAMP WITH TIME ZONE Type : Timestamp Timezone « SQL Data Types « Oracle PL/SQL Tutorial






The TIMESTAMP WITH TIME ZONE type extends TIMESTAMP to allow you to store a time zone.

SQL> CREATE TABLE mytimestamptz (
  2    id INTEGER,
  3    made_on TIMESTAMP(4) WITH TIME ZONE
  4  );

Table created.

SQL>
SQL> INSERT INTO mytimestamptz (id, made_on) VALUES (
  2    1, TIMESTAMP '2005-05-13 07:15:31.1234 -07:00'
  3  );

1 row created.

SQL>
SQL> INSERT INTO mytimestamptz (id, made_on) VALUES (
  2    1,TIMESTAMP '2005-05-13 07:15:31.1234 PST'
  3  );

1 row created.

SQL>
SQL> SELECT * FROM mytimestamptz;

        ID MADE_ON
---------- ---------------------------------------------------------------------------
         1 13-MAY-05 07.15.31.1234 AM -07:00
         1 13-MAY-05 07.15.31.1234 AM PST

SQL>
SQL> drop table mytimestamptz;

Table dropped.

SQL>








10.11.Timestamp Timezone
10.11.1.Using the TIMESTAMP WITH TIME ZONE Type
10.11.2.Add the time zone to your TIMESTAMP clause
10.11.3.Insert data to 'timestamp with time zone' type column
10.11.4.Use 'timestamp with time zone' type column in where clause
10.11.5.'timestamp with time zone' type column
10.11.6.'timestamp with local time zone' type column
10.11.7.Insert data into 'timestamp with local time zone' type column
10.11.8.Supply a time zone region
10.11.9.Using the TIMESTAMP WITH LOCAL TIME ZONE Type
10.11.10. Use 'TIMESTAMP(4) WITH LOCAL TIME ZONE' as column type