Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subclasses of java.util.Calendar available for commercial use - i.e. IslamicCalendar

I am looking for some subclasses of the Java calendar class, preferably a Hijri (Islamic) calendar implementation, but will potentially require more. Does anyone know of a library that is available for commercial use?

I have found IBM's ICU library (here), however, they do not extend java.util.Calendar and instead have written their own class which also replies on the custom classes; UDate and ULocale. I am attempting to I18n an existing java application which already has over 400 usages of Calendar so I ideally want to stick to that class. Any suggestions?

Thanks in advance.

like image 829
Ed . Avatar asked Jul 10 '09 12:07

Ed .


People also ask

What is the use of calendar class in Java?

The Calendar class is an abstract class that provides methods for converting between a specific instant in time and a set of calendar fields such as YEAR, MONTH, DAY_OF_MONTH, HOUR etc. Calendar provides a class method, getInstance which returns a Calendar object.

What is the use of clone and compareTo in Java calendar?

Clone method provides the copy of the current object. 6. The compareTo () method of Calendar class compares the time values (millisecond offsets) between two calendar object. 7. It fills any unset fields in the calendar fields. 8. It converts the current millisecond time value time to calendar field values in fields []. 9.

How to set the timestamp of a calendar object in Java?

Sets the designated parameter to the given java.sql.Timevalue, using the given Calendarobject. void RowSet.setTimestamp(int parameterIndex, Timestamp x, Calendar cal)


1 Answers

As usual with all Date API questions the answer is use Joda if possible, if not, make it possible.

I'd also be wary of IBM Date classes, they produced the current Java date API and while it's a big place, that implementation does not bode well for other offerings.

like image 71
Nick Holt Avatar answered Sep 30 '22 19:09

Nick Holt