Posts

Showing posts with the label ordinal date format coldfusion

How to display date in ordinal form in Coldfusion

 There are some requirements where we need to display the date value as ordinal form. For example, 31st august. Below code will do that in coldfusion. <cfset SuffixList=["st", "nd", "rd", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th", "th", "st"]> <cfoutput>#DateFormat(now(),'d')##SuffixList[DateFormat(now(),'d')]#</cfoutput>