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

CalendargetCalendar()
get Calendar
Calendar calendar = new GregorianCalendar(TimeZone.getTimeZone("GMT+09:00"), Locale.KOREA);
calendar.setTime(new Date());
return calendar;
CalendargetCalendar()
Get a calendar for the default timezone.
Calendar c = CACHED_CALENDAR.get();
if (c == null) {
    c = Calendar.getInstance();
    CACHED_CALENDAR.set(c);
c.clear();
return c;
CalendargetCalendar(boolean skipConversion)
get Calendar
Calendar calendar = skipConversion ? Calendar.getInstance(TimeZone.getTimeZone("UTC"))
        : Calendar.getInstance();
calendar.clear(); 
return calendar;
CalendargetCalendar(boolean skipConversion)
get Calendar
return skipConversion ? getLocalCalendar() : getGMTCalendar();
CalendargetCalendar(Calendar cal, int relativeDay)
get Calendar
cal.add(Calendar.DATE, relativeDay);
return cal;
CalendargetCalendar(final Date dateAndTime)
get Calendar
if (null == dateAndTime) {
    return null;
Calendar cal = (Calendar) Calendar.getInstance(UTC).clone();
cal.setTime(dateAndTime);
return cal;
CalendargetCalendar(final long timeInMillis)
get Calendar
return getCalendar(new Date(timeInMillis));
CalendargetCalendar(final String isodate)
get Calendar
final StringTokenizer st = new StringTokenizer(isodate, "-T:.+Z", true);
final Calendar calendar = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
calendar.clear();
try {
    if (st.hasMoreTokens()) {
        final int year = Integer.parseInt(st.nextToken());
        calendar.set(Calendar.YEAR, year);
    } else {
...
CalendargetCalendar(int d, int m, int y)
get Calendar
Calendar cal = Calendar.getInstance();
cal.set(Calendar.DAY_OF_MONTH, d);
cal.set(Calendar.MONTH, m);
cal.set(Calendar.YEAR, y);
return cal;
CalendargetCalendar(int dayOfWeek, int atHour, int atMinute)
get Calendar
Calendar cal = new GregorianCalendar();
cal.set(Calendar.DAY_OF_WEEK, dayOfWeek);
cal.set(Calendar.HOUR_OF_DAY, atHour);
cal.set(Calendar.MINUTE, atMinute);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
return cal;