List of utility methods to do Calendar Create
Calendar | createCalendar() create Calendar return Calendar.getInstance();
|
GregorianCalendar | createCalendar() This method creates and returns a new calendar. return createCalendar(null);
|
Calendar | createCalendar() create Calendar final Calendar calendar = GregorianCalendar.getInstance(UTC_TIME_ZONE, Locale.ENGLISH); calendar.clear(); calendar.set(2000, 0, 1); return calendar; |
Calendar | createCalendar() Create a Calendar instance with default timezone. return Calendar.getInstance(timeZone, locale);
|
Calendar | createCalendar() create Calendar Calendar c = Calendar.getInstance();
c.setTimeInMillis(0l);
return c;
|
Calendar | createCalendar(Date date) Creates a calendar from given date. Calendar cal = Calendar.getInstance(Locale.GERMANY);
cal.setTimeInMillis(date.getTime());
return cal;
|
Calendar | createCalendar(final int year, final int month, final int day) create Calendar final Calendar dateTime = Calendar.getInstance(); dateTime.clear(); dateTime.set(Calendar.YEAR, year); dateTime.set(Calendar.MONTH, month); dateTime.set(Calendar.DAY_OF_MONTH, day); return dateTime; |
Calendar | createCalendar(final int year, final int month, final int day, final int hour, final int minute, final int second) create Calendar Calendar c = Calendar.getInstance(); c.set(Calendar.YEAR, year); c.set(Calendar.MONTH, month - 1); c.set(Calendar.DAY_OF_MONTH, day); c.set(Calendar.HOUR_OF_DAY, hour); c.set(Calendar.MINUTE, minute); c.set(Calendar.SECOND, second); c.set(Calendar.MILLISECOND, 0); ... |
Calendar | createCalendar(final int year, final int month, final int dayOfMonth, final TimeZone timeZone) create Calendar return createCalendar(year, month, dayOfMonth, 0, 0, timeZone);
|
Calendar | createCalendar(int year, int month, int date) create Calendar GregorianCalendar calendar = new GregorianCalendar(); calendar.set(year, month - 1, date); return calendar; |