View Full Version : Adding st, nd, rd or th to a date

August 30th, 2016, 08:54 AM
Does anyone have a snippet of code for adding a postscript to a date? What I mean is instead of May 1, I want it to display as May 1st. May 2 would be May 2nd, May 3 would be May 3rd, etc. I am using a calendar to select the date and the format is MMDDYYYY.

I am currently using the following for formatting:

return FormatDate(Field("Event Date"), "ld, lm d");

Any help is greatly appreciated.


Dan Korn
August 30th, 2016, 09:34 AM
This is a frequently-asked question:

August 30th, 2016, 12:53 PM
I got it to work - Thanks Dan.

BTW - I did try to search for this question before posting, but I didn't know what ordinals were called, so I wasn't successful. Thanks for the info.