how would you write te date if i have a date and all i want is the month and the day like this (mm/dd) and then turn the month like this July, 08
the month and the day like this (mm/dd) and then turn the month like this July, 08
So you want to convert MM/dd
to MMMM, dd
? So you start with a String
and you end up with a String
? Then you need another SimpleDateFormat
instance with the first pattern.
String dateString1 = "07/08";
Date date = new SimpleDateFormat("MM/dd").parse(dateString1);
String dateString2 = new SimpleDateFormat("MMMM, dd").format(date);
System.out.println(dateString2); // July, 08 (monthname depends on locale!).