List of utility methods to do Day of Week Get
String | getDayOfWeekString(int dayOfWeek, int abbrev) Return a string for the day of the week. int[] list; switch (abbrev) { case LENGTH_LONG: list = sDaysLong; break; case LENGTH_MEDIUM: list = sDaysMedium; break; ... |
int | getDayofWeekInMonth(String year, String month, String weekOfMonth, String dayOfWeek) get Dayof Week In Month Calendar cal = new GregorianCalendar(); int y = new Integer(year).intValue(); int m = new Integer(month).intValue(); cal.clear(); cal.set(y, m - 1, 1); cal.set(Calendar.DAY_OF_WEEK_IN_MONTH, new Integer(weekOfMonth).intValue()); cal.set(Calendar.DAY_OF_WEEK, new Integer(dayOfWeek).intValue()); ... |
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); |
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(Date date) get Day Of Week Calendar cal = new GregorianCalendar(); cal.setTime(date); return cal.get(Calendar.DAY_OF_WEEK); |
int | getFirstDayOfWeek() Get first day of week as android.text.format.Time constant. int startDay = Calendar.getInstance().getFirstDayOfWeek(); if (startDay == Calendar.SATURDAY) return Time.SATURDAY; else if (startDay == Calendar.MONDAY) return Time.MONDAY; else return Time.SUNDAY; |
int | getDayOfTheWeek(Date date) get Day Of The Week Calendar c = Calendar.getInstance();
c.setTimeInMillis(date.getTime());
return c.get(Calendar.DAY_OF_WEEK);
|
int | getDayOfWeekZeroIndexed(Date dateTime) Returns the day of week as zero indexed. final Calendar calendar = Calendar.getInstance(); calendar.setTime(dateTime); final int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); switch (dayOfWeek) { case Calendar.MONDAY: return 0; case Calendar.TUESDAY: return 1; ... |
String | getReadableWeekDay(int day) get Readable Week Day return WEEKDAY[day - 1];
|
String | getStringDayOfWeek(Date date) get String Day Of Week SimpleDateFormat sdf = new SimpleDateFormat("EEEEE"); return sdf.format(date); |