Don't blame me if it doesn't work. Hasn't been tested. The paint is still wet.

<cfparam name="dateString" default="#now()#">

<cfset 
dayList="First,Second,Third,Fourth,Fifth,Sixth,Seventh,Eighth,Ninth,Tenth,Eleventh,Twelveth,Thirteenth,Fourteenth,Fifteenth,Sixteenth,Seventeenth,Eighteenth,Nineteenth,Twentieth,Twenty
 First,Twenty Second,Twenty Third,Twenty Fourth,Twenty Fifth,Twenty Sixth,Twenty 
Seventh,Twenty Eighth,Twenty Ninth,Thirtieth,Thirty First">
<cfset 
numList="One,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten,Eleven,Twelve,Thirteen,Fourteen,Fifteen,Sixteen,Seventeen,Eighteen,Nineteen">
<cfset numTenList="Ten,Twenty,Thirty,Fourty,Fifty,Sixty,Seventy,Eighty,Ninety">

<cfset y=year(dateString)>
<cfset m=monthasstring(month(dateString))>
<cfset d=listGetAt(dayList,day(dateString))>

<cfset y=right(10000+y,4)>
<cfset d1=mid(y,4,1)>
<cfset d2=mid(y,3,1)>
<cfset d3=mid(y,2,1)>
<cfset d4=mid(y,1,1)>

<cfset returnString="The #d# Day of #m#, in the year">
<cfif d4 gt 0>
        <cfset returnString=listAppend(returnString,"#listGetAt(numList,d4)# 
Thousand"," ")>
</cfif>
<cfif d3 gt 0>
        <cfset returnString=listAppend(returnString,"#listGetAt(numList,d3)# 
Hundred"," ")>
</cfif>
<cfif d2 gt 0 or d1 gt 0>
        <cfset returnString=listAppend(returnString,"and"," ")>
</cfif>
<cfif d2 eq 1>
        <cfif d2 gt 0>
                <cfset 
returnString=listAppend(returnString,"#listGetAt(numList,d2&d1)#"," ")>
        </cfif>
<cfelse>
        <cfif d2 gt 0>
                <cfset 
returnString=listAppend(returnString,"#listGetAt(numTenList,d2)#"," ")>
        </cfif>
        <cfif d1 gt 0>
                <cfset 
returnString=listAppend(returnString,"#listGetAt(numList,d1)#"," ")>
        </cfif>
</cfif>

<br><br>
<cfoutput>
#returnString#
</cfoutput>


>>> [EMAIL PROTECTED] 09/24/02 04:34PM >>>
Has anyone seen a tag or know of a way to get CF to produce the date in the 
following format:

09/22/2002 would read......The Twenty Second day of September, in the year 
Two Thousand and Two.



Steve


______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to