Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Function to convert date to words
Message
De
27/03/2003 12:52:17
 
 
À
27/03/2003 12:36:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00770814
Message ID:
00770854
Vues:
15
>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
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform