Please enable JavaScript to view this site.

A-Shell Reference

cformat switch: D

MM/DD/{CC}YY format or DD/MM/{CC}YY format, depending on language definition. Supports quite a bit of flexibility in formats, including dates with other delimiters (e.g. 12-31-24), no delimiters (e.g. 12312024), as well as dd-mon-{cc}yy format (e.g. 12-dec-2024). If a two digit year is specified, XTREE uses the SBR=CCYY in miame.ini for determining the century. The default value is equivalent to SBR=CCYY:60, meaning that any YY value of 60 or higher is assumed to 19YY; otherwise it is assumed to be 20YY.

Note that there is no internal validation or formatting logic associated with the D cformat code. Its purpose is solely to inform the sorting routine so that it can interpret the column data to be able to effectively sort it in chronological order. For editable date columns, the only way to enforce a consistent format is to use the Advanced Coldef Options InfDef=D and Format=<format string>, which cause the Windows date/time picker control to be used for editing.

Also note that date columns including both a date and a time (e.g. "25-May-24 08:25 PM") will be sorted taking both into account.

History

2023 June, A-Shell 6.5.1733:  Coldef "D" now recognizes SQL DATE and DATETIME formats CCYY-MM-DD {HH:MM{:SS}}. Previously they didn't sort properly. Note that if all the cells in the column are in that format, sorting will work with coldef "S" (string), but date filtering would not.