>>>>>Time for an extremely stupid question -- is there any particular reason why you have
>>>>>SET CENTURY TO 20
>>>>>instead of
>>>>>SET CENTURY TO 19
>>>>
>>>>Thanks. It seems that this was the solution to the riddle. Setting it to 19, I get the correct date. Why the setting is so, I have no idea - Visual ProMatrix set it automatically. (Nor do I have any clear idea why, according to Visual FoxPro, I should set century to 19, when we are actually in the 21st century...)
>>>
>>>It's zero based.
>>>
>>>IOW, the XX century is "all the years written as 19nn, including 2000 but excluding 1900", so this "set century to 19" is actually "set the hundreds part of the year to 19". The word century here is a complete misnomer.
>>
>>Even with these non-standard definitions, I would expect to have to specify the "century" as 20, since that's the "century" we are in, i.e., the current year starts with 20. But when I do that, I get a year that starts with 21 - so, a year in the 21st "century" according to the logic you explained. However, perhaps the ROLLOVER somehow adds one more digit to the century.
>
>Keep in mind that these things were written from the perspective of Y2K craze. So everyone had calendars with years beginning with 19 in their sights, and in that context it probably made sense.
>
>Now add 20 years to the context.
Considering that the specification was written from the perspective of someone who was living in the latter half of a century, it's written from "what made sense" at that time from his/her perspective. The default value "19" comes about because that's what the first two digits were at the time when the specification was thought up. In the perspective of someone living in the latter half of a century would think this would be sensible:
IF nYear > 100 THEN
ELSE
IF nYear < nRollover THEN
nYear = ((nCentury+1) * 100) + nYear
ELSE
nYear = (nCentury * 100) + nYear
ENDIF
ENDIF
...
Someone from the perspective of being in the earlier part of the century might look at the above logic might think that the logic is backwards.