Java Day of Week getFirstDayOfWeek(int year, int week)

Here you can find the source of getFirstDayOfWeek(int year, int week)

Description

get First Day Of Week

License

Open Source License

Declaration

public static Date getFirstDayOfWeek(int year, int week) 

Method Source Code

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

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

public class Main {

    public static Date getFirstDayOfWeek(int year, int week) {
        Calendar c = new GregorianCalendar();
        c.set(Calendar.YEAR, year);
        c.set(Calendar.MONTH, Calendar.JANUARY);
        c.set(Calendar.DATE, 1);/*from  w w  w . j a v a 2s. c  om*/

        Calendar cal = (GregorianCalendar) c.clone();
        cal.add(Calendar.DATE, week * 7);
        return cal.getTime();
    }
}

Related

  1. getDayWeekDateStr(Date date)
  2. getEndOfWeek(Date date)
  3. getFirstDayOfLastWeek(Date date)
  4. getFirstDayOfWeek(int year, int week)
  5. getFirstDayOfWeek(int year, int week)
  6. getFirstDayWeekly(final int year)
  7. getFirstMonthWeek(Date month)
  8. getFirstWeekdayBetween(Date fromDate, Date toDate, int dayOfWeek)
  9. getFirstWeekofMonth(Date date1)