Java Day of Week getWeekNumber(Date date, Integer day)

Here you can find the source of getWeekNumber(Date date, Integer day)

Description

get Week Number

License

Apache License

Parameter

Parameter Description
date a parameter
day a parameter

Return

Integer

Declaration

public static Integer getWeekNumber(Date date, Integer day) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

public class Main {
    public static Integer getWeekNumber(Date date) {
        return getWeekNumber(date, 0);
    }// w w w .j a  v  a  2 s  . c o  m

    public static Integer getWeekNumber(Date date, Integer day) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        return c.get(Calendar.WEEK_OF_MONTH) + day;
    }
}

Related

  1. getWeekEnd(Date date, int w)
  2. getWeekFirstDay(Date weekday)
  3. getWeekID(Date dateValue)
  4. getWeekNum(Date date)
  5. getWeekNumber(Date date)
  6. getWeekNumberFromDate(Date date)
  7. getWeekNumOfYear(Date date)
  8. getWeekOfDate(Date dt)
  9. getWeekOfDay(Date date)