Date and time data types

This section examines how date values are handled internally by SQL Anywhere, and how SQL Anywhere handles ambiguous date information, such as the conversion of a two digit year string value.

The following list provides a quick overview of how dates are handled:

  • SQL Anywhere always returns correct values for any legal arithmetic and logical operations on dates, regardless of whether the calculated values span different centuries.
  • At all times, the SQL Anywhere internal storage of dates explicitly includes the century portion of a year value.
  • The operation of SQL Anywhere is unaffected by any return value, including the current date.
  • Date values can always be output in full century format.

How dates are stored
Sending dates and times to the database
Retrieving dates and times from the database
Comparing dates and times
Using unambiguous dates and times
DATE data type
DATETIME data type
SMALLDATETIME data type
TIME data type
TIMESTAMP data type