javalocaleicu

Java sinhala locale date format using ICU4j not working


I'm working on a project which is Java SE Sinhalese Unicode application and i want to show date in Sinhalese.After searching on stackoverflow i found that i can use ICU4J but it didn't worked.

This the code i have used

ULocale locale = ULocale.forLanguageTag("si-LK"); 
dfDate = new SimpleDateFormat("MMMMM d, YYYY", locale.toLocale());
date = new Date();
lblDate.setText(dfDate.format(date));

but it still gives the output in English.


Solution

  • worked for me. ජ 7, 2014. Make sure you are using ICU's SimpleDateFormat in your import.