Tech Tip: Require users to enter 4 digits years for dates
PRODUCT: 4D | VERSION: 15.x | PLATFORM: Mac & Win
Published On: September 30, 2016
4D has the option of accepting 2 digits representing the year in date fields. For example:
1/25/00 -> Jan 25, 2000
1/25/15 -> Jan 25, 2015
1/25/30 -> Jan 25, 1930
1/25/50 -> Jan 25, 1950
1/25/80 -> Jan 25, 1980
This can sometimes be confusing as the century must be determined by the last two digits. Any value of the last two digits in an year below 30 is considered to be in the 21st century. Digits 30-99 is considered to be in the 20th century. This is default behavior, and can be modified using SET DEFAULT CENTURY.
To prevent confusion from the users, an entry filter can be used on the fields in a form. The entry filter:
!0&9##/##/#### |
To add an entry filter, click on the field/variable to apply the filter to, and add the filter above in the property list: