Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Y2K : 00 should be 2000 in the Year 2000 FP dos 2.6
Message
From
12/03/1999 04:48:09
 
 
To
10/03/1999 12:52:30
Diptesh Patel
Unitelsoftware Ltd.
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00195953
Message ID:
00196693
Views:
22
foxpro 2.6 always thinks a 8 character long date is in 20th century, ie it sees {dd/mm/xx} as {dd/mm/19xx}

I use this function
FUNCTION choosecent
PARAMETERS m.prdate, m.prnoyears
IF m.prdate={ / / }
RETURN m.prdate
ENDIF
IF PARAMETERS() < 2
m.prnoyears = 90
ENDIF
m.newdate=m.prdate
m.pryeardate=YEAR(DATE())
DO WHILE m.pryeardate-YEAR(m.newdate) >m.prnoyears
m.newdate=GOMONTH(m.newdate,1200)
ENDDO
DO WHILE YEAR(m.newdate)-m.pryeardate >100-m.prnoyears
m.newdate=GOMONTH(m.newdate,-1200)
ENDDO
RETURN m.newdate

Use it with two parameters (date,Z) and it will see if the date is more than Z years ago if it is, it goes forward to the correct century. (Z is set to default to 90)

Simon
Previous
Reply
Map
View

Click here to load this message in the networking platform