Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dates
Message
De
05/03/2003 22:54:30
 
 
À
04/03/2003 17:47:51
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Dates
Divers
Thread ID:
00761251
Message ID:
00761942
Vues:
28
I would start by creating a function like this:
function getDate (tcPattern as character, tcDate as character) as date

  * do some parameter error checking ...

  lnday   = at(tcpattern,[dd])  && position of day in pattern
  lnmonth = at(tcpattern,[mm])  && position of month in pattern
  lnyear  = at(tcpattern,[yy])  && position of year in pattern
  lnyearlen = iif([yyyy] $ tcpattern,4,2) && length of year in pattern

  return (ctod(substr(tcdate,lnmonth,2)+;
        "/"+substr(tcdate,lnday,2)+;
        "/"+substr(tcdate,lnyear,lnyearlen))

endfunc
This of course will only work if you know the pattern that is being applied. Now that we have entered a new century it is harder to determine year than it used to be cause what is: "01/02/03" ?

Have fun!
Carole Shaw
Fred Hutchinson Cancer Research Center

Eagles may soar, but weasels don't get sucked into jet engines.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform