List of utility methods to do Calendar Get
int | getMonth() get Month return cal().get(Calendar.MONTH);
|
int | getMonth(Calendar c) get Month if (c != null) { return c.get(Calendar.MONTH); } else { return Calendar.getInstance().get(Calendar.MONTH); |
int | getSecond(Calendar c) get Second if (c != null) { return c.get(Calendar.SECOND); } else { return Calendar.getInstance().get(Calendar.SECOND); |
long | getTimeByStr(String str) get Time By Str SimpleDateFormat sdf = new SimpleDateFormat(PARSE_DATE_FORMAT); Date date; try { date = sdf.parse(str); return date.getTime(); } catch (ParseException e) { e.printStackTrace(); return System.currentTimeMillis(); ... |
long | getTimeMillis() get Time Millis return System.currentTimeMillis();
|
String | getWeek(final Calendar calendar) get Week final int weekOfYear = calendar.get(Calendar.WEEK_OF_YEAR); return String.valueOf(weekOfYear); |
String | getWeek(final Long date) get Week final Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(date); return getWeek(calendar); |
int | getYear() get Year return cal().get(Calendar.YEAR);
|
int | getYear(Calendar c) get Year if (c != null) { return c.get(Calendar.YEAR); } else { return Calendar.getInstance().get(Calendar.YEAR); |
String | extractDateFromCalendarTime(Calendar time) extract Date From Calendar Time SimpleDateFormat dateFormatter = new SimpleDateFormat("dd-MM-yyyy"); return dateFormatter.format(time.getTime()); |