A normalization to DB timezone: : Timestamp « SQL Data Types « Oracle PL/SQL Tutorial






SQL> CREATE TABLE T (
  2  c1  DATE,
  3  c2  TIMESTAMP,
  4  c3  TIMESTAMP WITH TIME ZONE,
  5  c4  TIMESTAMP WITH LOCAL TIME ZONE);

Table created.

SQL>
SQL> DECLARE
  2
  3      v1  DATE;
  4      v2  TIMESTAMP;
  5      v3  TIMESTAMP WITH TIME ZONE;
  6      v4  TIMESTAMP WITH LOCAL TIME ZONE;
  7
  8  BEGIN
  9
 10
 11      v4 := TIMESTAMP '2002-11-03 03:00:00 -07:00';
 12      dbms_output.put_line(v4);
 13
 14      INSERT INTO t VALUES( v1, v2, v3, v4);
 15
 16  END;
 17  /

PL/SQL procedure successfully completed.

SQL>
SQL> select to_Char(c1, 'yyyy-mm-dd hh:mi:ss'),c2,c3,c4
  2  from t;

TO_CHAR(C1,'YYYY-MM
-------------------
C2
---------------------------------------------------------------------------
C3
---------------------------------------------------------------------------
C4
---------------------------------------------------------------------------



03-NOV-02 03.00.00.000000 AM


SQL>
SQL> DROP TABLE T;

Table dropped.

SQL>
SQL>








10.12.Timestamp
10.12.1.Use timestamps
10.12.2.timestamp column
10.12.3.Insert data into timestamp column
10.12.4.Using the TIMESTAMP Type
10.12.5.Round a timestamp
10.12.6.Use timestamp in insert statement
10.12.7.TIMESTAMP literal supports Time Zone (as offset from UTC). Default is SESSION Timezone:
10.12.8.A normalization to DB timezone: