Search code examples
ibm-midrangedb2-400

Is QTIMZON used to convert dates/timestamps on DB2 for i?


Concerning DB2 for i, are timestamp columns converted to UTC 0000 from the timezone specified in system setting QTIMZON? For example, if QTIMZON is set to UTC -0400 does any conversion to UTC 0000 take place before inserting a row?

I ask because MySQL and PostgreSQL both convert to/from UTC to the operating-system-specified timezone.

I am aware of the CURRENT TIMEZONE special register which leads me to believe no conversion is done automatically, but I wanted to be sure.


Solution

  • DB/2 for i does not appear to perform any timezone conversion according to the following test:

    CHGSYSVAL SYSVAL(QTIMZON) VALUE(QN0500EST3)
    

     

    CREATE TABLE QTEMP/TEST AS (SELECT NOW() TS FROM SYSIBM/SYSDUMMY1) WITH DATA
    
    SELECT TS FROM QTEMP/TEST
    ....+....1....+....2....+.
    TS                        
    2014-04-21-17.52.17.813498
    

     

    CHGSYSVAL SYSVAL(QTIMZON) VALUE(Q0000UTC)
    

     

    SELECT TS FROM QTEMP/TEST
    ....+....1....+....2....+.
    TS                        
    2014-04-21-17.52.17.813498