Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Adding "th", "nd", "rd" or "st" to dates

New Here ,
Aug 11, 2008 Aug 11, 2008
Hi All,

Has anyone come across a date formatting function which can add the appropriate "th", "nd", "rd" or "st" to a date?
I've done a fair bit of googling and haven't come across anything which takes into account that not all numbers ending in 1 should have an "st" appended to them (e.g. 11) or for that matter not all numbers ending in 2 should have a "nd" appended to them (e.g. 12) and so on.

Kylie
1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Aug 11, 2008 Aug 11, 2008
yep, seen one over at cflib.org.
can't recall what the function name is, though, sorry...

well, a quick check has foundit. here it is:
http://www.cflib.org/udf/GetOrdinal

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Translate
LEGEND ,
Aug 11, 2008 Aug 11, 2008
yep, seen one over at cflib.org.
can't recall what the function name is, though, sorry...

well, a quick check has foundit. here it is:
http://www.cflib.org/udf/GetOrdinal

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 11, 2008 Aug 11, 2008
LATEST
Brilliant! This worked like a charm. Thank you soooooo much.

Kylie
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 11, 2008 Aug 11, 2008
It would be pretty easy to write one. cfib.org is a repository of udf's if your searching to date has not taken you there.

By the way, where I live, it's the 11th and 12th, not the 11st and 12nd. But I guess it depends on your target audience.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 11, 2008 Aug 11, 2008
Thank you for the direction to cflib.org, I'm not really an experienced CF programmer, rather a designer looking after a CF site, so I wouldn't try to write one.

You should really read people's messages properly before you try to give them shtick though...I said not all numbers ending in one should have an "st" appended to them and my example of this exception was the number 11. Although I'm not proficient with CF, I am proficient with the English language. Obviously 11 and 12 are both suffixed with “th”, giving you 11th and 12th.

Regards,
Kylie
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources