Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Convert 18AUG04 to 08/18/2004
Message
 
 
To
18/08/2004 11:07:08
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00934126
Message ID:
00934207
Views:
24
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform