Conversion of 2-digit year input to 4 digits¶
Sculptor stores dates, internally and in files, as a day number counting 01/01/0001 as day 1. Therefore all stored dates have a 4-digit year.
However, unless Sculptor has been configured to prevent this (see Forcing 4-digit date input) dates may be input with a 1 or 2 digit year (e.g. “98”). Input of a 1-digit year assumes a preceding zero (i.e. “1” = “01”).
Such a date is called an ambiguous date. Sculptor converts ambiguous dates to four digits. By default, the century is determined by using a relative breakpoint of 10. See below for details of relative breakpoints.
The default behaviour can be changed by editing the file $SCULPTOR/default/dates.cfg.
To set a breakpoint value, add or change the line:
Breakpoint=integer
If the breakpoint value is negative, the century of an ambiguous date is set to the century of the current system date.
If the breakpoint value has four digits, it is an absolute breakpoint.
If the breakpoint value has one or two digits, it is a relative breakpoint.
Absolute breakpoint¶
A breakpoint with 4 digits is absolute. 2-digit years whose value is less than the last 2 digits of the breakpoint are deemed to be in the 21st century. 2-digit years whose value is >= the last 2 digits of the breakpoint are deemed to be in the 20th century.
EXAMPLE
Breakpoint=1930
Input year |
Converted year |
00, 01 … 29 |
000, 2001 …. 2029 |
30, 31 … 99 |
1930, 1931 … 1999 |
Relative breakpoint¶
A breakpoint with 2 digits is relative. A test date is constructed by adding the relative breakpoint value to the current system date. Input dates that have a 2-digit year are taken to be in the same century as the test date if the input year is <= the 2-digit year part of the test date, otherwise they are taken to be in the previous century.
The advantage of using a relative breakpoint is that the point at which the input date is deemed to belong to the previous century changes each year.
Note
If no breakpoint is defined in dates.cfg, Sculptor uses a relative breakpoint of 10.
EXAMPLE
Relative breakpoint |
System Date |
Input Date |
Stored Date |
10 |
1998 |
00 … 08 |
2000 … 2008 |
10 |
1998 |
09 … 99 |
1909 … 1999 |
10 |
2000 |
00 … 10 |
2000 … 2010 |
10 |
2000 |
11 … 99 |
1911 … 1999 |
15 |
2003 |
00 … 18 |
2000 … 2018 |
15 |
2003 |
26 … 99 |
1919 … 1999 |
10 |
2010 |
00 … 20 |
2000 … 2020 |
10 |
2010 |
21 … 99 |
1921 … 1999 |
10 |
2090 |
00 |
2100 |
10 |
2090 |
01 … 99 |
2099 |
RELATED TOPICS |