Java Week getWeekStartDate(Integer weekNumber)

Here you can find the source of getWeekStartDate(Integer weekNumber)

Description

get Week Start Date

License

Open Source License

Declaration

public static String getWeekStartDate(Integer weekNumber) 

Method Source Code

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

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {
    public static String getWeekStartDate(Integer weekNumber) {

        String weekDate;//from w ww  .ja v a 2  s  .  c o  m

        SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yy");
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.WEEK_OF_YEAR, weekNumber);
        cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
        weekDate = sdf.format(cal.getTime());
        //System.out.println(weekDate);

        return weekDate;
    }
}

Related

  1. getWeekNumber(String sdate)
  2. getWeekNumberFromDate(String thedate)
  3. getWeekNumByDate(String date)
  4. getWeekNumner(String date)
  5. getWeekOfMonth()
  6. isSameWeek(Date curDate, Date compareDate)
  7. startOfWeek(Date date, String format)
  8. weekAgo()
  9. weeksFromNow(int amount)