How to convert
in java
a string of format 2009/01
to a string of format 2009 January
?
Asked
Active
Viewed 35 times
-3

Kurenai Kunai
- 1,842
- 2
- 12
- 22

Jai
- 369
- 3
- 16
-
1have 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 Answers
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