Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Year 2000- 2 digit year entry
Message
De
31/12/1997 09:13:52
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00068469
Message ID:
00068592
Vues:
37
>>>>>>>I have created a UDF which allows the entry of 2 digit
>>>>>>>dates past 1/1/2000. Is this of any value? Have others
>>>>>>>created such functions?
>>>>>>>
>>>>>>>
>>>>>>>Ken Wardwell
>>>>>>
>>>>>>Ken,
>>>>>> Does it handle 2/29/2000??
>>>>>>
>>>>>>Thanx!
>>>>>>
>>>>>>Tony Miller
>>>>>>Vancouver, Wa
>>>>>
>>>>>Yes it handles 2/29/2000. and it is Fox 2.6
>>>>
>>>>Are you traeting the input as a Non-date input?? It was my understanding that everything in Foxpro before 5.0 would bomb on a date of 2/29/2000, since 2000 is a Leap Year, but is not a normal leap year..
>>>>
>>>>Thanx!
>>>>
>>>>Tony Miller
>>>>Vancouver, Wa
>>>
>>>Tony:
>>>
>>>Are you referring to a leap year rule that not all century dates (e.g., 2000, 2100) have a Feb 29? Feb 2000 does have 29 days, but Feb 2100 only has 28 days. I think the rule is that if the century year is evenly divisible by 400, Feb has 29 days. i.e., 2000 is divisible, but 2100, 2200 and 2300 are not. If you try testing in VFP, you will find this to be true. ctod("02/29/2100") is not a valid date, as is for the years 2200 and 2300. Thus the exception to the 4-year rule.
>>
>>Mark,
>> So this is still a problem in VFP 5??
>>
>>Thanx!
>>
>>Tony Miller
>>vancouver, Wa
>
>I don't think it's a problem in VFP 5.0 or FPW 2.6. Try the following (make sure to SET CENTURY ON):
>
>ldate = {2/28/2000}
>ldate = ldate + 1
>? ldate
>
>It should say (at least in my copy it does) 2/29/2000.
>
>George

It surly works. But most of the Screens ( Forms ) developed on 2.6 can only accept the last 2 digits. Therefore, if CENTURY is set ON, then instead of the year 98 the screen displays 19 ( first 2 letter of the year 1998 ). For a given date say {01/01/98}, the displayed date is {01/01/19}.

Rakesh
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform