- May
- 596
- 4
With the introduction of the new ISO-format dates formats 5 and 6, @DATE[], @DATECONV[], @MAKEAGE[], and other functions will accept a date specified with only two parts as if it were format 6.
ISO dates properly have 4-digit years, but TCC functions accept both 2- and 1-digit years.
The problem is, as I see it, that when a user manually enters a date with only two components, they are much more likely to mean month/date within the current year or date.month within the current year than some date in January in a low-numbered 21st century year. It is likely that a user who enters 04/07 means either April 7 or July 4 this year, and not Jan 7, 2004. Dates read from files, however, are likely to have the full 4-digit year and 3-digit day within the year.
So .BTM files processing file input would have no problem, but .BTM files handling user manual input may get incorrect dates.
I suggest that for recognition of a format 6 date where the input format is not explicitly stated, the year be required to be 4 digits. A 2-element date without a 'W' like 04-07 could be rejected as invalid format or interpreted as either day-month or month-day according to the default format. In older versions of TCC, a 2-element date was always rejected.
By way of example, my suggested is that @DATE[4-7,6] would be accepted as 2004-007 (and @DATE[2004-007] would be accepted as format 6), but @DATE[4-7] (without the ,6) would be either rejected or accepted as 04-07-%_year and interpreted as the default format (for formats 1 and 2) and for format 3 systems, it would be interpreted as %_year-04-07. Of course, not only @DATE, but also @DOW and all the other functions that take a date as input.
(Dates with a 'W', properly should have 4-digit years, but the 'W' truly does
make the intent unambiguous.)
ISO dates properly have 4-digit years, but TCC functions accept both 2- and 1-digit years.
The problem is, as I see it, that when a user manually enters a date with only two components, they are much more likely to mean month/date within the current year or date.month within the current year than some date in January in a low-numbered 21st century year. It is likely that a user who enters 04/07 means either April 7 or July 4 this year, and not Jan 7, 2004. Dates read from files, however, are likely to have the full 4-digit year and 3-digit day within the year.
So .BTM files processing file input would have no problem, but .BTM files handling user manual input may get incorrect dates.
I suggest that for recognition of a format 6 date where the input format is not explicitly stated, the year be required to be 4 digits. A 2-element date without a 'W' like 04-07 could be rejected as invalid format or interpreted as either day-month or month-day according to the default format. In older versions of TCC, a 2-element date was always rejected.
By way of example, my suggested is that @DATE[4-7,6] would be accepted as 2004-007 (and @DATE[2004-007] would be accepted as format 6), but @DATE[4-7] (without the ,6) would be either rejected or accepted as 04-07-%_year and interpreted as the default format (for formats 1 and 2) and for format 3 systems, it would be interpreted as %_year-04-07. Of course, not only @DATE, but also @DOW and all the other functions that take a date as input.
(Dates with a 'W', properly should have 4-digit years, but the 'W' truly does
make the intent unambiguous.)