Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Desperate for help with Year 2000 & CTOD incompatibility
Message
De
26/06/1998 12:34:07
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00111866
Message ID:
00111971
Vues:
45
>>>>I am trying to get my hands on a replacement function for the foxpro2.6 CTOD function.The problem is that this function will default to century 19 regardless of the system century when a variable is initialised with CTOD(' / / '). I've been told that such a replacement was provided with the March edition of Foxpro Advisor. Apparently it can be implemented using #DEFINE. Any help will be very, very much appreciated.
>>
>>>I'm not sure I understand you. With set century on there wouldn't be a problem. Can you elaborate it more ?
>>>Cetin
>>
>>Dermot,
>>
>>Cetin is correct, CTOD( ) works fine. But it is controlled by the SET CENTURY TO xx ROLLOVER yy, not by SET CENTURY ON | OFF. If your character date has a four digit year then that's what CTOD( ) uses. If your character date has a two-digit year, then CTOD( ) respects the setting of SET CENTURY TO xx ROLLOVER yy.
>>
>>Try the following (in VFP 5.0a):
>>
>
>SET CENTURY ON
>>SET CENTURY TO 19 ROLLOVER 50
>>
>>?{06/26/98} --> 06/26/1998
>>?{06/26/48} --> 06/26/2048
>>
>>?CTOD('06/26/98') --> 06/26/1998
>>?CTOD('06/26/48') --> 06/26/2048
>>
>>
>>BTW, you can display the values of the century default and rollover. In the example above,
>
>
>>?SET('CENTURY', 1) --> 19
>>?SET('CENTURY', 2) --> 50
>>
>>
>>HTH,
>>Rick
>
>For the sake of completeness, I should have added examples using a four-digit year:
>
>?ctod('06/26/1948') --> 06/26/1948 always
>?ctod('06/26/2048') --> 06/26/2048 always
>?ctod('06/26/1998') --> 06/26/1998 always
>?ctod('06/26/2098') --> 06/26/2098 always
>
>
>Rick
So Rick ?
AFAIK with "set century on" and 4 digit entry, I see no problem in any Fox version (including those w/o rollover clause). I think I should start using 2 digit entry to understand Y2K problem.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform