Java Utililty Methods Week Calculate

List of utility methods to do Week Calculate

Description

The list of methods to do Week Calculate are organized into topic(s).

Method

intweekCount(Date start, Date end)
week Count
final Calendar startCalendar = Calendar.getInstance();
startCalendar.setTime(start);
final Calendar endCalendar = Calendar.getInstance();
endCalendar.setTime(end);
final int startWeekofYear = startCalendar.get(Calendar.WEEK_OF_YEAR);
final int endWeekofYear = endCalendar.get(Calendar.WEEK_OF_YEAR);
int count = endWeekofYear - startWeekofYear + 1;
if (Calendar.SUNDAY != startCalendar.get(Calendar.DAY_OF_WEEK)) {
...
intweekNumber()
week Number
return weekNumber(new GregorianCalendar());
intweeksInYear(int year)
weeks In Year
Calendar c = Calendar.getInstance();
c.set(Calendar.YEAR, year);
return c.getActualMaximum(Calendar.WEEK_OF_YEAR);
GregorianCalendarweekStart()
week Start
return weekStart(new GregorianCalendar());