DB2- Date and Timestamp-Timezone

Great and important topic of DB2 Date/Time/Timestamp. Reference IBM.

DATEdate is a three-part value representing a year, month, and day in the range of 0001-01-01 to 9999-12-31.
TIMEtime is a three-part value representing a time of day in hours, minutes, and seconds, in the range of 00.00.00 to 24.00.00.
TIMESTAMPtimestamp is a seven-part value representing a date and time by year, month, day, hour, minute, second, and microsecond, in the range of 0001-01-01- to 9999-12-31- with nanosecond precision. Timestamps can also hold timezone information

How Much Memory DB2 DATE, Time and TimeStamp Takes

  • DB2 Date – takes 4 bytes.
  • DB2 Time – 3 bytes.
  • DB2 Timestamp – It takes 10 bytes.

DB2 – Timestamp with timezone: The format is


For example:


If you do not enter a value for a TIMESTAMP WITH TIME ZONE column, Optim uses the current DB2 SESSION TIME ZONE value.

DB2 Session Time:

Usually local time Zone. This can be achieved by-


DB2 Database Time: It is equal to CURRENT TIME ZONE

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.