List of utility methods to do Calendar Get
int | getDate(Calendar c) get Date if (c != null) { return c.get(Calendar.DATE); } else { return Calendar.getInstance().get(Calendar.DATE); |
String | getDateAsDirName() get Date As Dir Name "yyyy-MM-dd" Calendar cal = Calendar.getInstance(); java.text.SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String cdate = sdf.format(cal.getTime()); return cdate; |
String | getDateAsF() get Date As F "yyyyMMddHHmmss" Calendar cal = Calendar.getInstance(); java.text.SimpleDateFormat sdf = new SimpleDateFormat( "yyyyMMddHHmmss"); String cdate = sdf.format(cal.getTime()); return cdate; |
String | getDateAss() get Date As "MM-dd-HH-mm" Calendar cal = Calendar.getInstance(); java.text.SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-HH-mm"); String cdate = sdf.format(cal.getTime()); return cdate; |
String | getDateMin() get Date Min, "yyyy-MM-dd HH:mm" Calendar cal = Calendar.getInstance(); java.text.SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm"); String cdate = sdf.format(cal.getTime()); return cdate; |
int | getDay() get Day return cal().get(Calendar.DAY_OF_WEEK);
|
int | getDay(Calendar c) get Day if (c != null) { return c.get(Calendar.DAY_OF_WEEK); } else { return Calendar.getInstance().get(Calendar.DAY_OF_WEEK); |
Timestamp | getFirstOfWeek(Calendar cal, int week) get First Of Week if (cal == null) {
cal = Calendar.getInstance();
cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
...
|
long | getFragmentInDays(Calendar calendar, int fragment) Returns the number of days within the fragment. return getFragment(calendar, fragment, Calendar.DAY_OF_YEAR);
|
long | getFragmentInHours(Calendar calendar, int fragment) Returns the number of hours within the fragment. return getFragment(calendar, fragment, Calendar.HOUR_OF_DAY);
|