locale-specific formatting.
import java.util.Calendar;
import java.util.Formatter;
import java.util.Locale;
public class Main {
public static void main(String args[]) {
Formatter fmt = new Formatter();
Calendar cal = Calendar.getInstance();
fmt = new Formatter();
fmt.format("Default locale: %tc\n", cal);
fmt.format(Locale.GERMAN, "For Locale.GERMAN: %tc\n", cal);
fmt.format(Locale.ITALY, "For Locale.ITALY: %tc\n", cal);
fmt.format(Locale.FRANCE, "For Locale.FRANCE: %tc\n", cal);
System.out.println(fmt);
}
}
Related examples in the same category