tags:

views:

65

answers:

1

Hi,

From the java doc, the MEDIUM format is: MEDIUM is longer, such as Jan 12, 1952

http://java.sun.com/j2se/1.4.2/docs/api/java/text/DateFormat.html

How can I customize it so that I does not display the year? And spell out "Jan" to January?

Do I need to do that myself? * chop off the string after the ',' * have a table which map the month short name (Jan) to its long name (January)?

Thank you.

+11  A: 

Use SimpleDateFormat:

// For months like "Jan"
String formatted = new SimpleDateFormat("MMM dd").format(new Date());

// For months like "January"
String formatted = new SimpleDateFormat("MMMMM dd").format(new Date());
Rob Hruska