TIMESTAMP WITH TIME ZONE Type

TIMESTAMP WITH TIME ZONE extends TIMESTAMP to store a time zone. An example of a timestamp literal with a time zone offset of -07:00:

TIMESTAMP '2012-08-21 08:16:31.1234 -07:00'

Or to specify a time zone region as PST time zone:

TIMESTAMP '2012-08-21 08:16:31.1234 PST'

CREATE TABLE myTable(
id       INTEGER,
hiredate TIMESTAMP(4) WITH TIME ZONE
); 


INSERT INTO myTable(id, hiredate) VALUES (1, TIMESTAMP '2012-06-21 08:17:31.1234 -07:00' ); 
INSERT INTO myTable(id, hiredate) VALUES (1, TIMESTAMP '2012-06-13 08:12:31.1234 PST' ); 

SQL> SELECT * FROM myTable;

        ID                             HIREDATE
-----------------------------------------------
         1    21-JUN-12 08.17.31.1234 AM -07:00
         1    13-JUN-12 08.12.31.1234 AM PST


SQL>
Home »
Oracle »
Data types » 

Timestamp:
  1. Timestamp
  2. TIMESTAMP WITH TIME ZONE Type
  3. TIMESTAMP WITH LOCAL TIME ZONE Type
Related: