IBM Support

Determining the timezone used by the DB2 server

Question & Answer


Question

Timezone specifies the difference between UTC(Coordinated Universal Time, formerly known as GMT) and local time (addition from Louise: at the application server?). This document demonstrates two ways to determine the timezone currently used by the DB2 server.

Answer

To obtain the timezone, use either one of the following methods:

Method 1: Using db2diag.log

  • In db2diag.log, the timestamp indicates the timezone:
  • 2006-05-30-14.11.02.407777+600 I4153330G543 LEVEL: Severe
    The +600 value represents the timezone in minutes, +600 / 60 = +10 hours.

Method 2: Using CURRENT TIMEZONE special register
  • Using CURRENT TIMEZONE special register as shown in the following SQL statement:


  • db2 "select current timestamp as local,
                current timezone as timezone,
                current timestamp - current timezone as UTC
    from sysibm.sysdummy1"
You get the following output:

LOCAL                      TIMEZONE UTC
-------------------------- -------- --------------------------
2006-05-30-16.32.26.945121 100000.  2006-05-30-06.32.26.945121

  1 record(s) selected.

The 10000 value is a decimal number in which the first two digits are the number of hours, the next two digits are the number of minutes, and the last two digits are the number of seconds.

Related Information

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Routines (SP & UDF) - Internal Routines","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.5;9.1;8","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21251354