Skip to content

Date, Time, Timestamp

Date, Time, Timestamp#

This section explains the meanings of Date, Time, and Timestamp which are DATE types, and describes the data conversion range supported by the Altibase JDBC driver.

Meanings#

  • Date: Expresses only the date
  • Time: Expresses the time(the date can be included)
  • Timestamp: Expresses the date, time, seconds and further subdivisions of time

Conversion Table#

The following table shows the formats that are processed by the Altibase JDBC driver according to the object type passed to the setObject method.

Delivery Object String Date Time Timestamp
setObject
(DATE)
2134-12-23 00:00:00.0
An error is raised if the user inputs values to the hour:minute:second. The driver sets it to 0.
2134-12-23 00:00:00.0
The values input to the hour:minute:second are ignored by the driver.
SQLException: UNSUPPORTED_TYPE_CONVERSION 2134-12-23 12:34:56.123456
setObject
(TIME)
1970-01-01 12:34:56.0
An error is raised if the user inputs values to the year:month:date or a value to the nanosecond. The driver sets it to the standard year:month:date.
2134-12-23 12:34:56.0 2134-12-23 12:34:56.0 2134-12-23 12:34:56.0
setObject
(TIMESTAMP)
2134-12-23 12:34:56.123456 2134-12-23 00:00:00.0
The values input to the hour:minute:second are ignored by the driver.
SQLException: UNSUPPORTED_TYPE_CONVERSION 2134-12-23 12:34:56.123456
setString() Must be input in the format set for the DATE_FORMAT property. - - -
setDate() - 2134-12-23 00:00:00.0
hour:minute:second are ignored by the driver.
- -
setTime() - - 2134-12-23 12:34:56.0 -
setTimestamp() - - - 2134-12-23 12:34:56.123456

The following table shows the values returned from the DATE type value (1234-01-23 12:23:34.567123) stored in the database with the getDate(), getTime(), and getTimestamp() methods.

Function Return Value
getDate() 1234-01-23 00:00:00.0
getTime() 1234-01-23 12:23:34.0
getTimestamp() 1234-01-23 12:23:34.567123