I use DateFormat and locale to show Day and Month. DateFormat supports MEDIUM, LONG, FULL all have a year.I only want to show month and day.
I tried to use SimpleDateFormat, but SimpleDateFormat defined the order of month and day. In different countries, date format is different. I don't want to define the order of month and day. I hope the date format is decided by locale.
Here is my code and how can I remove year from the date?
Locale myLocale =Locale.FRANCE;
DateFormat localFormatter = DateFormat.getDateInstance(DateFormat.MEDIUM, myLocale);
String localDate = localFormatter.format(date);
I tried the following locale and print the date on the right:
Locale myLocale =Locale.FRANCE; localDate=1 avr. 2018
Locale myLocale =Locale.CHINA; localDate=2018-4-1
Locale myLocale =Locale.JAPAN; localDate=2018/04/01