-3

How to convert in java a string of format 2009/01 to a string of format 2009 January?

Kurenai Kunai
  • 1,842
  • 2
  • 12
  • 22
Jai
  • 369
  • 3
  • 16
  • 1
    have a look [here](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html), may help you.. – earthmover Jun 02 '15 at 07:18

2 Answers2

1

Try something like:

String date = "2009/01";
String format = "yyyy/mm";
Date dateObj = new SimpleDateFormat(format).parse(date);
String newFormat = "yyyy MMM";
System.out.println(new SimpleDateFormat(newFormat).format(dateObj));
SMA
  • 36,381
  • 8
  • 49
  • 73
0
Date date = new SimpleDateFormat("yyyy/MM").parse("2009/01");
String format = new SimpleDateFormat("yyyy MMMM").format(date);
System.out.println(format);
Kurenai Kunai
  • 1,842
  • 2
  • 12
  • 22