Contents Index Sending and retrieving date values Ambiguous string to date conversions

ASA SQL Reference
  SQL Data Types
    Year 2000 compliance

Leap years


The year 2000 is a leap year, with an additional day in the month of February. Adaptive Server Anywhere uses a globally accepted algorithm for determining which years are leap years. Using this algorithm, a year is considered a leap year if it is divisible by four, unless the year is a century date (such as the year 1900), in which case it is a leap year only if it is divisible by 400.

Adaptive Server Anywhere handles all leap years correctly. For example, the following SQL statement results in a return value of "Tuesday":

SELECT DAYNAME('2000-02-29')

Adaptive Server Anywhere accepts February 29, 2000—a leap year—as a date, and using this date determines the day of the week.

However, the following statement is rejected by Adaptive Server Anywhere:

SELECT DAYNAME('2001-02-29')

This statement results in an error (cannot convert '2001-02-29' to a date) because February 29th does not exist in the year 2001.


Contents Index Sending and retrieving date values Ambiguous string to date conversions