Mike, the precendence is not hindering you to first assign a ROLLOVER and then SET CENTURY ON. If you then convert short date strings, the rollover year is still in effect, i.e. SET CENTURY ON does not reset the rollover year. What offfset you need depends on what dates you can enter. Birth dates, for example should always be past dates, except perhaps for predicted date of birth within 9 months from now. Well, but any planning dates, appointments, etc are of course usually future dates. Therefore the offset you set depends on your needs, but you can set it, even when you decide to finally SET CENTURY ON. SET("CENTURY",2) will also still show you the rollover year as one proof of it not being reset to default or inactivated.
For demonstration purposes:
Code:
Set Date American
Set Century To 19 Rollover 75
Set Century On
? Set("Century",2)
? Ctod("01/01/25")
? Ctod("01/01/75")
? Ctod("01/01/90")
Set Century To 19 Rollover 90
Set Century On
? Set("Century",2)
? Ctod("01/01/25")
? Ctod("01/01/75")
? Ctod("01/01/90")
The rollover century and years are still in full effect, even if you set CENTURY ON after setting the rollover mechanism. That's what makes the precedence unimportant.
The problem of 25 being interpreted as 1925 instead of 2025 seems to me a fixed setting of the Rollover century and year that was okay at the time it was established, but wasn't introduced in a danmically way adapting to the current year, as you surely want a current year short date to convert to the current century.
While I recommend SET CENTURY ON, you still can have a ROLLOVER year (and century) defined so your short date string conversion (for data entry works, for CSV import, etc). Ultimately, avoid any short dates, anyway. While you have a way to nudge them to the right century when knowing whether they should be past, future or current year, it's not giving you a chance with historical dates more than 100 years ago or future dates more than 100 years into the future. While you don't plan 100 years into the future, usually, there are people older than 100 years and the number of them grows. History also doesn't shorten ever, so for documentation purposes you want to be able to specify all dates of the past. and also display the century to know what dates we talk about in case of a year like 92, whether it's 1992 or 1892 or even 1492.
I'm not sure SET SYSFORMATS ON "imports" the Windows setting into VFPs Rollover concept. Worth a try to have influence from outside, it won't help, if what I assume is causing the problem, a fixed setting somewhere in the code, in the worst case, unconfigurable and not able to be influenced by neither Windows ssettings nor config.fpw or other configuration data, INIs etc. So you can try and get lucky, if that helps, it's worth doing, considering how little effort it is, but in the end you might need hands on the source code to fix this.