613-518-1166 info@zimdatabases.com

ZIM Programs and Utilities

Century Threshold And Default Century

< All Topics

century threshold n

default century n

where n is a numeric entry (see below for more information)

These two configuration options control the century used when date-masked fields contain ‘ YY’ instead of ‘ YYYY’.

If a field is masked only with ‘ YY’ and not ‘ YYYY’, then the end-user cannot enter the century, and Zim assumes the century is 19. Application developers are strongly urged to either i) use ‘ YYYY’ to mask date fields, or ii) use the two configuration options to automatically increment the century for certain date ranges.

Note:The former approach always works, while the latter works for applications with well-defined input data that falls into certain date ranges.

The default century is a number from 0 to 99 that is copied to the century position of a date when the end-user can enter only two year digits. If the century threshold is -1, then this default century is used verbatim. If century threshold is on the range 0 to 99, then the default century is incremented if the year entered by the end-user is less than n. The table below gives examples of resulting dates given user input and the input mask of ‘MM/DD/ YY’:

User Input Default Century Century Threshold Resulting Date ( YYYYMMDD)
12/12/94 19 -1 19941212
12/12/94 20 -1 20941212
12/12/01 19 30 20011212
12/12/35 19 30 19351212
12/12/35 20 30 20351212

In general, if your application must deal with widely-ranging dates, then use an input mask of ‘ YYYY’ to obtain expected results. However, if your application deals with dates of events occurring in the present, such as tagging orders with the order date, then an input mask of ‘ YY’ is sufficient, and set century threshold to a value, such as 50.

Valid Settings – Default Century

nn = numeric entry 0 to 99

Windows -1
UNIX -1

Valid Settings – Century Threshold

nn = numeric entry -1 to 99

Windows 19
UNIX 19

 

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?

Submit a Comment

Your email address will not be published. Required fields are marked *

Table of Contents