List of utility methods to do Day of Week
int | calculateBusinessDays(Date startDate, Date endDate, int firstWeekendDay, int secondWeekendDay) calculate Business Days Calendar startCal = Calendar.getInstance(); startCal.setTime(startDate); Calendar endCal = Calendar.getInstance(); endCal.setTime(endDate); int workDays = 0; if (startCal.getTimeInMillis() == endCal.getTimeInMillis()) { return 0; if (startCal.getTimeInMillis() > endCal.getTimeInMillis()) { startCal.setTime(endDate); endCal.setTime(startDate); do { startCal.add(Calendar.DAY_OF_MONTH, 1); if (startCal.get(Calendar.DAY_OF_WEEK) != firstWeekendDay && startCal.get(Calendar.DAY_OF_WEEK) != secondWeekendDay) { workDays++; } while (startCal.getTimeInMillis() <= endCal.getTimeInMillis()); return workDays; |
String | Day_Of_Week(String Date, int DayCase) Da O Week StringBuffer dow = new StringBuffer( DOW[(int) (Math.floor((Cal_Julian(Date) + 2) - (Math.floor((Cal_Julian(Date) + 2) / 7) * 7)))]); if ((DayCase == 1) || (DayCase == 2) || (DayCase == 3)) dow = new StringBuffer(dow.substring(0, 3)); switch (DayCase) { case 1: case 4: return dow.toString().toUpperCase(); ... |
int | dayForWeek(String pTime) day For Week SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); Calendar c = Calendar.getInstance(); int dayForWeek = 0; try { c.setTime(format.parse(pTime)); if (c.get(Calendar.DAY_OF_WEEK) == 1) { dayForWeek = 7; } else { ... |
int | dayForWeek(String pTime) day For Week SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Calendar c = Calendar.getInstance(); try { c.setTime(format.parse(pTime)); } catch (ParseException e) { e.printStackTrace(); int dayForWeek = 0; ... |
List | dayForWeek(String weeks) day For Week List<String> retDates = new ArrayList<String>(); int day = 1; SimpleDateFormat time = new SimpleDateFormat("yyyy-MM-dd"); while (retDates.size() < 4) { Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, day); if (weeks.contains(String.valueOf(cal.get(Calendar.DAY_OF_WEEK) - 1))) { System.out.println(cal.get(Calendar.DAY_OF_WEEK) - 1); ... |
int | dayNumberOfWeek(Date date) Day Number Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal.get(Calendar.DAY_OF_WEEK);
|
int | DayOfTheWeek(Date dt) Day Of The Week Calendar cal = new GregorianCalendar(); cal.setTime(dt); return cal.get(Calendar.DAY_OF_WEEK); |
int | dayOfWeek(Date date) day Of Week Calendar cal = Calendar.getInstance(); cal.setTime(date); int dayWeek = cal.get(Calendar.DAY_OF_WEEK); return dayWeek; |
int | dayOfWeek(Date inDate, TimeZone timeZone) Calculate the day number for the given date. Calendar calendar = Calendar.getInstance(timeZone);
calendar.setTime(inDate);
return calendar.get(Calendar.DAY_OF_WEEK);
|
int | dayOfWeek(Date time) day Of Week Calendar c = Calendar.getInstance(); c.setTime(time); int dayForWeek = 0; if (c.get(Calendar.DAY_OF_WEEK) == 1) { dayForWeek = 7; } else { dayForWeek = c.get(Calendar.DAY_OF_WEEK) - 1; return dayForWeek; |