Date does not accept Locale in android

I need to specify dates in my application in German. Therefore, when I create a calendar object, I do this:

GregorianCalendar gc = new GregorianCalendar(Locale.GERMANY);

To display the date obtained from the above, do the following with the class SimpleDateFormat:

SimpleDateFormat sdf = new SimpleDateFormat("EEEE ddmmyy");
Log.i("the parsed string", sdf.format(gc.getTime());

The above should return the day name in German, but it still returns it in English. What am I doing?

thank you in advance.

+3
source share
1 answer

Try installing Locale in the constructor SimpleDateFormat.

SimpleDateFormat sdf = new SimpleDateFormat("EEEE ddmmyy", Locale.GERMANY);
+1
source

All Articles