List of utility methods to do Week Day
String | getWeekBeginDay(String date) get Week Begin Day Calendar cal = Calendar.getInstance(); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); cal.setTime(df.parse(date)); cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY); return df.format(cal.getTime()); |
String | getWeekDay() get Week Day String weekday; Date date = new Date(); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); int week_index = calendar.get(Calendar.DAY_OF_WEEK) - 1; switch (week_index) { case 0: { weekday = "sunday"; ... |
String | GetWeekDay() Get Week Day Calendar c = Calendar.getInstance(); int dayOfWeek = c.get(Calendar.DAY_OF_WEEK); switch (dayOfWeek) { case 2: return "monday"; case 3: return "tuesday"; case 4: ... |
String | getWeekDay() get Week Day int weekDay = Calendar.getInstance().get(Calendar.DAY_OF_WEEK); System.out.println(weekDay); String weekDay1 = String.valueOf(weekDay); return weekDay1; |
int | getWeekday(Date date) Function: get the date's weekday Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
return calendar.get(Calendar.DAY_OF_WEEK);
|
String | getWeekDay(Date date) get Week Day return getFormat(week).format(date);
|
Date | getWeekDay(Date dt, int weekDay) get Week Day Calendar cal = new GregorianCalendar(); cal.setTime(dt); if (weekDay == 7) { weekDay = 1; } else { weekDay++; cal.set(GregorianCalendar.DAY_OF_WEEK, weekDay); ... |
int | getWeekDay(int weekday) get Week Day if (weekday == 1) { return Calendar.MONDAY; } else if (weekday == 2) { return Calendar.TUESDAY; } else if (weekday == 3) { return Calendar.WEDNESDAY; } else if (weekday == 4) { return Calendar.THURSDAY; ... |
String | getWeekDay(String date) get Week Day return formatDateTime(parse(date), "EE"); |
String | getWeekday(String date) get Weekday SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdw = new SimpleDateFormat("E"); Date d = null; try { d = sd.parse(date); } catch (ParseException e) { e.printStackTrace(); d = new Date(); ... |