SimpleDateFormat returns string date in different languages

dasdasd picture dasdasd · Jul 2, 2013 · Viewed 25.5k times · Source

Im using SimpleDateFormat to parse the correct date.

Sometimes when i use SimpleDateFormat it returns the me the date in other language than english.

I want the date string to be only in english. Is the possible?

See my code and pictures.

Here is my formater:

SimpleDateFormat df = new SimpleDateFormat("d-MMMM-yyyy", Locale.ENGLISH);

Here is same app but string is in different languages:

enter image description here

enter image description here

Thanks for helping

Answer

Shani Goriwal picture Shani Goriwal · Jul 2, 2013

You have to change

SimpleDateFormat df = new SimpleDateFormat("d-MMMM-yyyy", Locale.ENGLISH);

to

SimpleDateFormat df = new SimpleDateFormat("d-MMMM-yyyy", Locale.US);