Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Function to convert date to words
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00770814
Message ID:
00770843
Vues:
19
Yes, as I said, correct it.

>Think it needs some work. ;)
>
>You'd get 11st, 12nd, 13nd with what you've got.
>
>
>
>>This is what came to my mind. Correct it if needed:
>>
>>?dconvert(date())
>>
>>*----------------------
>>Procedure dconvert
>>LPARAMETERS lDdate
>>LOCAL lcday, lcth
>>
>>lcday=TRANSFORM(DAY(lDdate))
>>
>>DO case
>>CASE right(lcday,1)="1"
>> lcth="st"
>>CASE right(lcday,1)="2"
>> lcth="nd"
>>CASE right(lcday,1)="3"
>> lcth="rd"
>>otherwise
>> lcth="th"
>>ENDCASE
>>RETURN lcday+lcth+" day of "+CMONTH(lDdate)+", "+TRANSFORM(YEAR(lDdate))
>>
>>
>>
>>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform