Question : Is Foxpro 2.5  y2k  compliant?

With set century off, assuming I'm in the 21st century,
will 01/23/02 be interpreted as Jan 23, 2002?

Answer : Is Foxpro 2.5  y2k  compliant?

The short answer to your question is no, 02 would be interpreted as 1902 because FPW 2.5 sees all 2 digit years as 1900.  More detailed explanation from Microsoft follows:

<<
Description of how the product handles dates:
Dates in tables, variables, and calculations are treated as numeric data representing the number of days since some fixed date.

2-digit dates are always seen as 20th century dates. Therefore, it is recommended to use only 4-digit dates.

2-digit shortcut handling:
Even using the command Set Century On and entering a 2-digit shortcut for a year, the product will always consider the date within the 20th Century. With Set Century Off, all dates entered are considered to be in the 20th century.


Product Issues:

Use Set Century On
The feature of the product causes all versions of FoxPro and Visual FoxPro to use 4-digit dates for data entry and display. The product default is Set Century Off. In the Off setting, it can be impossible to enter 4-digit dates and 2-digit dates are always interpreted as 1900.

Don't use LUPDATE().
When you use Set Century On with a computer that has the system date set to the year 2000 and a modification is made to the structure of a table (.dbf) file, or a copy of the table file is made, the LUPDATE() function incorrectly displays the century as 1900. This display occurs because the date of the last update is stored in the header of the .dbf file using only 2 digits.

Proper Use of Date Constants
Date constants of the form {mm/d/yy} are valid. 2-digit years would always be interpreted as 19yy. In 5.0 and later, The Set Century To...Rollover command will cause these same 2-digit constants to be interpreted according to the specified century and rollover year. To be safe, always specify 4-digit years.

In addition, date constants have no fixed field ordering. While this does not necessarily pose errors related to the Year 2000, it can cause date errors when the constants are evaluated or compiled under different values for Set Date, which specifies the locale date format. In Fox Pro 5.0, we introduced the syntax {^yyyy/mm/dd} so that the caret would force the constant into the YMD ordering.


Common date usage errors:
Using Set Century Off. Using CTOD and CTOT to build dates with 2-digit years. Using 2-digit years in date constants.


Testing guidelines and recommendations:
Modify existing apps to use Set Century On settings. Check for 2-digit dates in dates constants and whenever using the functions CTOD() and CTOT().
>>
Random Solutions  
 
programming4us programming4us