List of utility methods to do Calendar Create
Calendar | getCalendar() get Calendar Calendar calendar = new GregorianCalendar(TimeZone.getTimeZone("GMT+09:00"), Locale.KOREA); calendar.setTime(new Date()); return calendar; |
Calendar | getCalendar() 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; |
Calendar | getCalendar(boolean skipConversion) get Calendar Calendar calendar = skipConversion ? Calendar.getInstance(TimeZone.getTimeZone("UTC")) : Calendar.getInstance(); calendar.clear(); return calendar; |
Calendar | getCalendar(boolean skipConversion) get Calendar return skipConversion ? getLocalCalendar() : getGMTCalendar();
|
Calendar | getCalendar(Calendar cal, int relativeDay) get Calendar cal.add(Calendar.DATE, relativeDay);
return cal;
|
Calendar | getCalendar(final Date dateAndTime) get Calendar if (null == dateAndTime) { return null; Calendar cal = (Calendar) Calendar.getInstance(UTC).clone(); cal.setTime(dateAndTime); return cal; |
Calendar | getCalendar(final long timeInMillis) get Calendar return getCalendar(new Date(timeInMillis)); |
Calendar | getCalendar(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 { ... |
Calendar | getCalendar(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;
|
Calendar | getCalendar(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; |