I have saved dates by formatting them using SimpleDateFormat
.
DateFormat dateForm = new SimpleDateFormat("HH mm ss dd MMM ''yy");
String dateOutput = dateForm.format(new Date());
This uses the default Locale of the device, for example French or Spanish.
How do I convert this string (formatted for a different Locale) back to a Date
object formatted with Locale.ENGLISH
?
Currently when I try to convert the string back into a date, I get an unparseable date exception. This is caused by the fact the the date was saved using a different Locale
Try this class to convert Spanish Date To English or English Date to Spanish. You can change to cultures with a small change.
This can work for you
EDIT
The way I am thinking is to break it down with
Calendar
object and formatting it in another language. Try thisThis does work for me however it is not the most elegant of solutions. Tweek it for your code.