List of utility methods to do Calendar Create
Calendar | createIsoCalendar() The ISO week-numbering year starts at the first day (Monday) of week 01 and ends at the Sunday before the new ISO year (hence without overlap or gap). Calendar cal = new GregorianCalendar(); cal.clear(); cal.setMinimalDaysInFirstWeek(4); cal.setFirstDayOfWeek(2); return cal; |
Calendar | createResetCalendar() Creates a new reset (non-lenient) calendar with the default time zone. return createResetCalendar(TimeZone.getDefault());
|
String | createTimestampStr(Calendar para_calendar) create Timestamp Str String retTStamp = ""; retTStamp += (para_calendar.get(Calendar.DAY_OF_MONTH)); retTStamp += ("/" + (para_calendar.get(Calendar.MONTH) + 1)); retTStamp += ("/" + para_calendar.get(Calendar.YEAR)); retTStamp += (" " + para_calendar.get(Calendar.HOUR_OF_DAY)); retTStamp += (":" + para_calendar.get(Calendar.MINUTE)); retTStamp += (":" + para_calendar.get(Calendar.SECOND)); return retTStamp; ... |
Calendar | getCalendar() Get calendar instance with default time zone of GMT+8 TimeZone.setDefault(getDefaultTimeZone());
return Calendar.getInstance();
|
Calendar | getCalendar() returns Calendar#getInstance() with Calendar#setMinimalDaysInFirstWeek(int) set to 4. Calendar c = Calendar.getInstance();
c.setMinimalDaysInFirstWeek(4);
return c;
|
Calendar | getCalendar() get Calendar Calendar c = CACHED_CALENDAR.get(); if (c == null) { c = Calendar.getInstance(); CACHED_CALENDAR.set(c); return c; |
Calendar | getCalendar() get GregorianCalendar. return new GregorianCalendar(); |
Calendar | getCalendar() Returns a calendar instance. return getCalendar(null, null);
|
Calendar | getCalendar() get Calendar return Calendar.getInstance();
|
Calendar | getCalendar() Returns a Calendar instance. return Calendar.getInstance(locale);
|