Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting date formats
Message
From
25/01/2007 23:27:49
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
25/01/2007 21:26:48
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6
Miscellaneous
Thread ID:
01189445
Message ID:
01189449
Views:
13
>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.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform