Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Y2K : 00 should be 2000 in the Year 2000 FP dos 2.6
Message
De
12/03/1999 04:48:09
 
 
À
10/03/1999 12:52:30
Diptesh Patel
Unitelsoftware Ltd.
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00195953
Message ID:
00196693
Vues:
23
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform