ProblemYou need to deal with dates in a form other than the Gregorian Calendar used in the Western world. SolutionDownload the IBM calendar classes. DiscussionThe only nonabstract Calendar subclass is the GregorianCalendar, as mentioned previously. However, other calendar classes do exist. IBM has a set of calendars Hebrew, Islamic, Buddhist, Japanese, and even an Astronomical Calendar class that covers most of the rest of the world. This work has been open sourced and is now part of a project called International Components for Unicode for Java, which can be found at http://oss.software.ibm.com/icu4j/. The calendar classes in ICU4J work in a similar fashion to the standard GregorianCalendar class, but they have constants for month names and other information relevant to each particular calendar. They are not subclassed from java.util.Calendar, however, so they must be referred to by their full class name: import java.util.Locale; import com.ibm.icu.util.Calendar; import java.text.DateFormat; import com.ibm.icu.util.IslamicCalendar; public class IBMCalDemo { public static void main(String[] args) { Locale ar_loc = new Locale("ar"); Calendar c = new com.ibm.icu.util.IslamicCalendar( ); DateFormat d = DateFormat.getDateInstance(DateFormat.LONG, ar_loc); System.out.println(d.format(c.getTime( ))); } } I can't include the textual output because of font limitations. The icu4j package includes a multicalendar demo application whose output is shown in Figure 6-1. Figure 6-1. IBMCalDemo in action |