import java.text.*;
import java.util.*;
public class LocaleFormat {
public static void main(String args[]) {
Locale[] locales = {Locale.UK, Locale.FRANCE, Locale.ITALIAN};
Date date = new Date();
String s;
for (int i = 0; i < locales.length; i++) {
s = SimpleDateFormat.getDateInstance(SimpleDateFormat.FULL,
locales[i]).format(date);
System.out.println(locales[i].getDisplayLanguage() + "\t : " + s);
}
}
}
|
English : Saturday, 11 October 2008
French : samedi 11 octobre 2008
Italian : sabato 11 ottobre 2008 |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Formatting Date for a Locale Example
Post your Comment