Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Alpha date converted to numeral date
Message
De
16/03/2001 12:43:50
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00485959
Message ID:
00485989
Vues:
8
Hey Jim,

This'll do it.
LPARAMETERS cLongDate
nStrictdate=SET("STRICTDATE")
cDate=RIGHT(cLongDate,4)
cMonths="   JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"
cMonthNum=TRANSFORM((AT(UPPER(LEFT(cLongDate,3)),cMonths)-1)/3)
cDayNum=TRANSFORM(VAL(SUBSTR(cLongDate,AT(" ",cLongDate)+1,2)))
cDate=cMonthNum+"/"+cDayNum+"/"+cDate
dDate=CTOD(cDate)
SET STRICTDATE TO nStrictdate
RETURN dDate
Use as dMyDate=CVRTDATE("Sept 9,1999")

>I once used a function or precedure I thought I downloaded from the knowledge base that I can't seem to find now. This code took a spelled out date like, Sept 3, 1999, and converted to a numeral date of 09/03/1999. Would someone know what that article number was on Knowledge base, or have the actual code that would convert the date type?
>
>TIA
>
>Jim
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform