Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Date Formatting for characters like st/nd/rd/th after the Date

807588May 13 2009 — edited May 13 2009
JDK provided so many features for date formatting but i would like to know how can we achieve date in below format

11th May 2009 (i want to know how to get "th" part of this).

I can calculate this by writing code for it but is their any kind of inbuilt feature in JDK to achieve it.

1*st* - How to get st?
2*nd* - How to get nd?
3*rd* - How to get rd?
4*th* - How to get th?

In some languages, there are variables like S available to get this but i do not think it is available in JDK.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 10 2009
Added on May 13 2009
4 comments
467 views