---
title: "DB2- Date and Timestamp-Timezone"
description: "How to use DATE, TIME and TIMEZONE in DB2 SQL you can learn and apply in your projects."
url: https://srinimf.com/2014/05/11/db2-date-and-timestamp-timezone/
date: 2014-05-11
modified: 2026-10-07
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2014/05/session-time-in-db2.jpg?fit=1200%2C900&ssl=1
categories: ["DB2"]
tags: ["DB2 Timezone", "Timestamp with timezone"]
type: post
lang: en
---

# DB2- Date and Timestamp-Timezone

Great and important topic [of DB2](https://srinimf.com/2010/05/02/db2-time-formats/) Date/Time/Timestamp. Reference IBM.

| DATE | A date is a three-part value representing a year, month, and day in the range of 0001-01-01 to 9999-12-31. |
| --- | --- |
| TIME | A time 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. |
| TIMESTAMP | A timestamp 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-00.00.00.000000000 to 9999-12-31-24.00.00.000000000 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

**YYYY-MM-DD.HH.MM.SS.ssssss(+|-)HH:MM**

For example:

2011-05-19.10.19.00.000000-5:00

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-

SET SESSION TIMEZONE as -8:00

DB2 Database Time: It is equal to CURRENT TIME ZONE

Related Posts

- [How to Insert Values into Timestamp Column in DB2](https://srinimf.com/2017/10/05/db2-question-on-timestamp-function-points-you-need/)DateOctober 5, 2017
- [DB2- Date, Time, Timestamp](https://srinimf.com/2011/02/06/db2-date-time-timestamp/)DateFebruary 6, 2011
- [DB2 DATE and Time Conversion: Top SQL Queries](https://srinimf.com/2022/10/22/how-to-understand-db2-date-and-time-sql-queries/)DateOctober 22, 2022

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2014%2F05%2F11%2Fdb2-date-and-timestamp-timezone%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2014%2F05%2Fsession-time-in-db2.jpg%3Ffit%3D1200%252C900%26ssl%3D1&description=DB2-%20Date%20and%20Timestamp-Timezone)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2014/05/11/db2-date-and-timestamp-timezone/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2014/05/11/db2-date-and-timestamp-timezone/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2014/05/11/db2-date-and-timestamp-timezone/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2014/05/11/db2-date-and-timestamp-timezone/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20DB2-%20Date%20and%20Timestamp-Timezone&body=https%3A%2F%2Fsrinimf.com%2F2014%2F05%2F11%2Fdb2-date-and-timestamp-timezone%2F&share=email)
-

### Like this:

Like Loading…