Java Day of Week getDateOfYearWeek(int yearNum, int weekNum, int dayOfWeek)

Here you can find the source of getDateOfYearWeek(int yearNum, int weekNum, int dayOfWeek)

Description

get Date Of Year Week

License

Open Source License

Declaration

private static Date getDateOfYearWeek(int yearNum, int weekNum, int dayOfWeek) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;
import java.util.Date;

public class Main {
    private static final int DAYS_OF_A_WEEK = 7;

    private static Date getDateOfYearWeek(int yearNum, int weekNum, int dayOfWeek) {
        Calendar cal = Calendar.getInstance();
        cal.setFirstDayOfWeek(Calendar.MONDAY);
        cal.set(Calendar.DAY_OF_WEEK, dayOfWeek);
        cal.setMinimalDaysInFirstWeek(DAYS_OF_A_WEEK);
        cal.set(Calendar.YEAR, yearNum);
        cal.set(Calendar.WEEK_OF_YEAR, weekNum);
        /*cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.MINUTE, 0);/*from w ww  .ja  v  a2  s. com*/
        cal.set(Calendar.SECOND, 0);*/
        return cal.getTime();
    }
}

Related

  1. getDateByWeek(int week)
  2. getDateByYearAndWeekNum(int year, int weekNum)
  3. getDateForCurrentWeekDay(int day)
  4. getDateOfWeek(int week)
  5. getDateOfWeek(int year, int weekOfYear, int i)
  6. getDateWeek(String date)
  7. getDay(long date, int startOfWeek, int increment)
  8. getDayAfterGivenDate(Date date, int dayOfWeek)
  9. getDayOfWeek()