Representing Dates in Other Epochs
Problem
You need to deal with dates in a form other than the Gregorian Calendar used in the western world.
Solution
Visit the IBM alphaWorks web site.
Discussion
As of Java 2, the only non-abstract Calendar
subclass is the GregorianCalendar, as mentioned
previously. However, others do exist. Check out the
IBM
alphaWorks web site (http://alphaworks.ibm.com), which has a large
collection of freely available Java software (mostly without source
code, alas). Search for “calendar”, and you’ll find
a set of calendars -- Hebrew, Islamic, Buddhist, Japanese, and
even an Astronomical Calendar class -- that
covers most of the rest of the world.
These work in a similar fashion to the standard
GregorianCalendar class, but have constants for
month names and other information relevant to each particular
calendar.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access