• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Date Formating  RSS feed

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i will be given number(only day no month and year) between 01 and 31 , i want to format the number in such a way that

if it is "1" i have to display it as "1st"
if it is "2" i have to display it as "2nd"
if it is "3" i have to display it as "3rd"
..
..
..
if it is "31" i have to display it as "31st"

is there any date utility which does this function directly.
 
Marshal
Posts: 60795
190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't come across a utility which automatically changes 1 to 1st, I am afraid.
Whenever I wanted to do that, I have had to do it the hard way.

CR
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!