The DB2 datetime data type is one of the Data Types in the DB2 database. The following section describes the DB2 datetime data types for you.
DB2 datetime data types include DATE, TIME, and TIMESTAMP. Datetime values can be used in some arithmetic and string operations and are compatible with some strings, but they are neither strings nor numbers.
* DATE: DATE is a three-part value year, month, and day ). The year range is from 0001 to 9999. The range of month is from 1 to 12. The range of day is from 1 to n, where the value of n depends on the month. The DATE column is 10 bytes long.
* TIME: TIME is a value consisting of three parts: hour, minute, and second ). The hour range is from 0 to 24. The minute and second ranges from 0 to 59. If the hour is 24, the values of minute and second are both 0. The TIME column is 8 bytes long.
* TIMESTAMP: TIMESTAMP is a value that consists of seven parts: year, month, day, hour, minute, second, And microsecond ). The year range is from 0001 to 9999. The range of month is from 1 to 12. The range of day is from 1 to n, where the value of n depends on the month. The hour range is from 0 to 24. The minute and second ranges from 0 to 59. The microsecond part ranges from 000000 to 999999. If the hour is 24, the minute value, second value, and microsecond value are both 0. The TIMESTAMP column is 26 bytes long. String Representation of the datetime value: although the internal representation of the values of DATE, TIME, and TIMESTAMP is transparent to users, the DATE, TIME, and TIMESTAMP can also be expressed in strings, for the CHAR scalar function, see "part of speech parts of speech)" in SQL. It can be used to create a string representation of a date and time value.
* A date value string is a string of no less than 8 characters starting with a number. The minus zero in the month and day of the date value can be omitted.
* A Time Value string starts with a number and is a string of no less than four characters. The hour part of the time value can be omitted, and the second part can be completely omitted. If the second value is not specified, it is regarded as 0.
* The string of the time stamp value indicates a string starting with a number and with a length of not less than 16 characters. The complete time stamp string is represented as a yyyy-mm-dd-hh.mm.ss.nnnnnn. The zeros in front of the month, day, or hour of the time stamp value can be omitted, and the microseconds can be truncated or completely omitted. If the microsecond part of the timestamp value is omitted at the end of zero, it is assumed that the number of vacant digits is zero.
The preceding section describes the DB2 Date and Time data types.
Introduction to DB2 numeric data types
How to install a DB2 database in LINUX
DB2 Management page size limit
DB2 database startup failure Solution
Policy Selection for DB2 environment variable Management