Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting date formats
Message
From
26/01/2007 02:21:04
 
 
To
25/01/2007 23:27:49
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6
Miscellaneous
Thread ID:
01189445
Message ID:
01189460
Views:
9
>>How do you convert this kind of date format 01-AUG-99 to 07/01/1999?
>
>Subtract a month?
>
>Kidding aside... something like this:
>
>
lparameters tcDate
>lnDay=val(getwordnum(tcDate,1,"-/."))
>lnYear=val(getwordnum(tcDate,3,"-/."))
>lnMonth=int(atc(getwordnum(tcDate,2,"-/."), " JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC")/4)+1
>return date(lnyear, lnmonth, lnday)
>
>...more or less. The month calculation may nead some tweaking before it works right.

This will not work in VFP 6 because it misses the getwordnum() function. Evelyn, it's about time to upgrade, you will be much more productive with VFP 9.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform