You should find something useful in the documentation for
Formatter. There is also
this class, but it appears to be a Swing class, so probably less useful.
You may have to write your own utility method to get "th": remember 1 21 31 = "st" 2 22 = "nd" 3 = "rd" remainder = "th". If you get the 33rd of the month, you have got problems