Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

Definition and Characteristics

Definition

DATE-TIME data types are used to represent the date or time (or both together). CUBRID supports the following data types:

Date-Time Types Supported by CUBRID

Type

Mim

Max

Note

DATE

0001-01-01

9999-12-31

0-0-0 is not allowed.

TIME

00:00:00

23:59:59

0:0:0 is not allowed.

TIMESTAMP

1970-01-01 00:00: 00(GMT)
1970-01-01 09:00:00(KST)

2038-01-10 03:14:07 (GMT)
2038-01-19 12:14:07 (KST)

Note that TIMESTAMP at the point of entering data is not stored even though data is inserted into or updated in the TIMESTAMP column.

Exceptionally, a value for DATETIME '0000-00-00 00:00:00' will be changed to the minimum value.

DATETIME

0001-01-01 00:00:000

9999-12-31 23:59:599

Exceptionally, a value for DATETIME '0000-00-00 00:00:00' will be changed to the minimum value.

Characteristics

Range and Resolution

  • By default, the range of a time value is represented by the 24-hour system. Dates follow the Gregorian calendar. An error occurs if a value that does not meet these two constraints is entered as a date or time.
  • The range of year in DATE is 0001 - 9999 AD.
  • From the CUBRID 2008 R3.0 version,if time value is represented with two-digit numbers, a number from 00 to 69 is converted into a number from 2000 to 2069; a number from 70 to 99 is converted into a number from 1970 to 1999. In earlier than CUBRID 2008 R3.0 version, if time value is represented with two-digit numbers, a number from 01 to 99 is converted into a number from 0001 to 0099.
  • The range of TIMESTAMP is from January 1, 1970 00:00:00 GMT to January 19, 2038 03:14:07. For KST (GMT+9), values from January 1, 1970 00:00:00 to January 19, 2038 12:14:07 can be stored.
  •  The results of date, time and timestamp operations may differ depending on the rounding mode. In these cases, for Time and Timestamp, the most approximate second is used as the minimum resolution; for Date, the most approximate date is used as the minimum resolution.

Coercions

The Date-Time types can be cast explicitly using the CAST operator only when they have the same field. For implicit coercion, see Implicit Type Conversion. The following table shows types that allows explicit coercions. For implicit coercion, see Arithmetic Operation and Type Casting of DATE/TIME Data Types.

Explicit Coercions

FROM TO

DATE

TIME

DATETIME

TIMESTAMP

DATE

--

X

O

O

TIME

X

--

X

X

TIMESTAMP

O

O

--

O

DATETIME

O

O

O

--