Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Function to convert date to words
Message
From
27/03/2003 12:56:23
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00770814
Message ID:
00770857
Views:
12
I noticed that also, that's why I modified the code in the message I posted. I was still playing around with it when I noticed the teens didn't work. It can still be streamlined.


>>You have to do your own function (unless someone knows of one that will do it for you, but I do not):
>
>Yours falls short in a similar manner to Yuri's. You'd get the right results, but for the wrong reason, as long as they were processed in order. IE: 9,10,11 will yield 9th, 10th, 11th, but if you were just to ask for 11 only, you'd just get 11 or an error as ext would be undefined.
>
>
>
>>
>>lcday=RIGHT(ALLTRIM(STR(DAY(DATE()))),1)
>>DO CASE
>>  CASE INLIST(lcday,'4','5','6','7','8','9','0')
>>    ext = 'th'
>>  CASE lcday = '1'
>>    ext = 'st'
>>  CASE lcday = '2'
>>    ext = 'nd'
>>  CASE lcday = '3'
>>    ext = 'rd'
>>ENDCASE
>>clongdate=ALLTRIM(STR(DAY(DATE())))+ext+" of "+CMONTH(DATE())+", "+ALLTRIM(STR(YEAR(DATE())))
>>?clongdate
>>
>>
>>>Are there any VFP functions or 3rd party routines that can convert a date to text. IE 11/23/2002 converts to "23rd day of November, 2002"
>>>
>>>Thanks for you help
>>>Stephen Hunt
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform