Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set century
Message
 
 
À
12/05/2005 11:35:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01013353
Message ID:
01013458
Vues:
11
Greg,

I think year(date())%100 + 1 is the correct formula. Yours would not work for year 2100+.

Anyway, seems like Yuri identified the bug (undocumented behavior) of the SET CENTURY command. E.g. you can not combine ON and TO settings together.

>CHange the SET CENTURY to this...
>
>
>SET CENTURY TO 19 ROLLOVER MAX(0,YEAR(DATE())-2000)
>for i=1 to 10
>	?ctod('01/01/'+ transform(m.i))
>NEXT
>
>
>I used this to solve the Y2K issue years ago.
>
>>This works for me:
>>
>>lnyear=VAL(RIGHT(DTOC(DATE()),2))+1
>>set century ON TO 19 ROLLOVER lnyear
>>
>>for i=1 to 10
>>	?ctod('01/01/'+ transform(m.i))
>>next
>>
>>
>>>Hi everybody,
>>>
>>>I want to be able to type two year digits in the date textbox and treat dates this way: if they less than current year, e.g. 01/01/05 treat them as 2005, otherwise, 1/1/43 treat as 1/1/1943. I could not make it to work, have to admit.
>>>
>>>I'm using VFP9.
>>>
>>>Can you please help me?
>>>
>>>Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform