Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Convert 18AUG04 to 08/18/2004
Message
 
 
À
18/08/2004 11:07:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00934126
Message ID:
00934207
Vues:
23
>Hello,
>
>How to convert the date from
>
>18AUG04 to become 08/18/2004
>
>tia

Here is a one-liner:
cDateToConvert = "18AUG04"
Set Century On
? Date( 2000 + Val( SubStr( cDateToConvert, 6 )) ;
	, (At( SubStr( cDateToConvert, 3, 3 ), "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC" ) + 2) / 3 ;
	, Val( cDateToConvert ))
And you could wrap the whole thing in a DtoC() if you want a string instead of a date.
censored.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform