// // Example of using Date, DateFormat. // // Usage: // java InternationalDates // // Description: // Shows the current date/time formatted for several different // "locales". // // Example of use: // java InternationalDates // (be prepared for a lot of output!) // import java.util.*; import java.text.*; public class InternationalDates { public static void main(String[] args) { Locale[] locales = DateFormat.getAvailableLocales(); for (int i = 0; i < locales.length; ++i) { System.out.println("For locale " + locales[i].getDisplayName() + ":"); System.out.println("Date is " + DateFormat.getDateTimeInstance( DateFormat.LONG, DateFormat.LONG, locales[i]).format(new Date()) ); System.out.println(""); } } }