Java Utililty Methods Calendar Create

List of utility methods to do Calendar Create

Description

The list of methods to do Calendar Create are organized into topic(s).

Method

CalendarcreateCalendar()
create Calendar
return Calendar.getInstance();
GregorianCalendarcreateCalendar()
This method creates and returns a new calendar.
return createCalendar(null);
CalendarcreateCalendar()
create Calendar
final Calendar calendar = GregorianCalendar.getInstance(UTC_TIME_ZONE, Locale.ENGLISH);
calendar.clear();
calendar.set(2000, 0, 1);
return calendar;
CalendarcreateCalendar()
Create a Calendar instance with default timezone.
return Calendar.getInstance(timeZone, locale);
CalendarcreateCalendar()
create Calendar
Calendar c = Calendar.getInstance();
c.setTimeInMillis(0l);
return c;
CalendarcreateCalendar(Date date)
Creates a calendar from given date.
Calendar cal = Calendar.getInstance(Locale.GERMANY);
cal.setTimeInMillis(date.getTime());
return cal;
CalendarcreateCalendar(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;
CalendarcreateCalendar(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);
...
CalendarcreateCalendar(final int year, final int month, final int dayOfMonth, final TimeZone timeZone)
create Calendar
return createCalendar(year, month, dayOfMonth, 0, 0, timeZone);
CalendarcreateCalendar(int year, int month, int date)
create Calendar
GregorianCalendar calendar = new GregorianCalendar();
calendar.set(year, month - 1, date);
return calendar;