Specify the default order of date parts when interpreting a date string.
date_order=value
MDY, YMD, DMY
YMD (this corresponds to ISO date format specifications)
For Android devices, you can use Connection.setOption(OPTION_DATE_ORDER, value) as an alternative to setting this creation option.
The default order for year, month, and day corresponds to the ISO 8601 date format. For example, "06-01-07" is interpreted as January 7, 2006.
You can specify a different order for the interpretation of date parts. For example, if "06-01-07" represents June 1, 2007 then specify "MDY" for the date order.
You can only specify the date order for a new database. Once the database has been created, you cannot change the date order.
From SQL Central, you can set the date order in any wizard that creates a database. On the New database creation parameters page, click the Date Order option.
From a client application, set this option as one of the creation options for the CreateDatabase method on the DatabaseManager/ULDatabaseManager class.
Different values determine how the date 10/11/12 is interpreted:
Date order | Interpretation |
---|---|
MDY | October 11 2012 |
YMD | November 12 2010 |
DMY | November 10 2012 |
Use the nearest_century option to control the interpretation of two-digit years in string-to-date conversions.
The following SQL query returns 2010-11-12 using the default date_order and nearest_century settings.
SELECT CAST( CAST( '10/11/12' AS DATE ) AS VARCHAR(15) );