List of utility methods to do Week Day
int | getDayOfWeek(long date) Returns the day of the week. Calendar calendar = CALENDAR; synchronized (calendar) { calendar.setTimeInMillis(date); return (calendar.get(Calendar.DAY_OF_WEEK)); |
int | getDayOfWeek(long date) Returns the day of the week. Calendar calendar = CALENDAR; synchronized (calendar) { calendar.setTimeInMillis(date); return (calendar.get(Calendar.DAY_OF_WEEK)); |
int | GetDayOfWeek(long p) Get Day Of Week Date t = long2Date(p); GregorianCalendar gc = new GregorianCalendar(); gc.setTime(t); switch (gc.get(Calendar.DAY_OF_WEEK)) { case Calendar.SUNDAY: return 0; case Calendar.MONDAY: return 1; ... |
String | getDayOfWeek(String dat) get Day Of Week dat = dat.replaceAll("-", ""); int yy = Integer.valueOf(dat.substring(0, 4)).intValue(); int mm = Integer.valueOf(dat.substring(4, 6)).intValue(); int dd = Integer.valueOf(dat.substring(6)).intValue(); String[] dayOfWeek = { "sun", "mon", "tue", "wed", "thu", "fri", "sat" }; Calendar c = Calendar.getInstance(); c.set(yy, mm - 1, dd); return dayOfWeek[c.get(Calendar.DAY_OF_WEEK) - 1]; ... |
int | getDayOfWeek(String date) get Day Of Week String[] temp = null; if (date.indexOf("/") > 0) { temp = date.split("/"); if (date.indexOf("-") > 0) { temp = date.split("-"); return getDayOfWeek(temp[0], temp[1], temp[2]); ... |
int | getDayOfWeek(String year, String month, String day) get Day Of Week Calendar cal = new GregorianCalendar(new Integer(year).intValue(), new Integer(month).intValue() - 1, new Integer(day).intValue()); return cal.get(Calendar.DAY_OF_WEEK); |
String | getDayOfWeekAbbreviation(int day) get Day Of Week Abbreviation switch (day) { case java.util.Calendar.SUNDAY: return "SU"; case java.util.Calendar.SATURDAY: return "SA"; case java.util.Calendar.FRIDAY: return "FR"; case java.util.Calendar.THURSDAY: ... |
String | getDayOfWeekAbreviated(Date d) get Day Of Week Abreviated Calendar cal = Calendar.getInstance(); cal.setTime(d); int ret = cal.get(Calendar.DAY_OF_WEEK); if (ret == Calendar.MONDAY) return "Seg"; if (ret == Calendar.TUESDAY) return "Ter"; if (ret == Calendar.WEDNESDAY) ... |
String | getDayOfWeekShortString(Date date) get Day Of Week Short String int dayOfWeek = getDayOfWeek(date); switch (dayOfWeek) { case 1: return "Sun"; case 2: return "Mon"; case 3: return "Tue"; ... |
int | getDaysExceptWeekend(String from, String to) get Days Except Weekend if (from.compareTo(to) > 0) { String tmp = from; from = to; to = tmp; Calendar begin = parseCalendar(from); Calendar end = parseCalendar(to); int sum = 0; ... |