Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Y2k Bug in all flavours of FoxPro
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00098306
Message ID:
00098330
Views:
27
>I have just recently discovered a bug in all version of FoxPro including VFP 5. If you turn century on and type a date in an empty date field with only two digits for year and press enter, then always the 19 is added to the two digit year you entered, no matter what date is set in your PC.

It's meant to do that.

Have you looked at the new ROLLOVER clause of SET CENTURY?


Syntax

SET CENTURY ON | OFF | TO [nCentury [ROLLOVER nYear]]

Arguments

ON Specifies a four-digit year in a format that includes 10 characters (including date delimiters).

OFF (Default) Specifies a two-digit year in a format that includes eight characters and assumes the twentieth century for date calculations.

TO nCentury A number from 1 to 99 that specifies the current century. When a date has a two digit year, nCentury determines in which century the year occurs.

Issue SET CENTURY TO without any additional arguments to restore the default current century.

SET CENTURY ON

SET CENTURY TO 19
? {02/16/56} && Displays 02/16/1956

SET CENTURY TO 20
? {02/16/56} && Displays 02/16/2056

ROLLOVER nYear A number from 0 to 99 that specifies the year above which is the current century and below which is the next century.

Issue SET CENTURY TO without any additional arguments to restore the default century rollover year to 0.

SET CENTURY ON

SET CENTURY TO 19 ROLLOVER 60
? {02/16/96} && Displays 02/16/1996

? {02/16/56} && Displays 02/16/2056

Remarks

Use SET CENTURY to specify how date variables and functions are displayed.

SET CENTURY is scoped to the current data session.
Previous
Reply
Map
View

Click here to load this message in the networking platform