Android Date Get getDayofWeekInMonth(String year, String month, String weekOfMonth, String dayOfWeek)

Here you can find the source of getDayofWeekInMonth(String year, String month, String weekOfMonth, String dayOfWeek)

Description

get Dayof Week In Month

Declaration

public static int getDayofWeekInMonth(String year, String month,
            String weekOfMonth, String dayOfWeek) 

Method Source Code

//package com.java2s;

import java.util.Calendar;

import java.util.GregorianCalendar;

public class Main {
    public static int getDayofWeekInMonth(String year, String month,
            String weekOfMonth, String dayOfWeek) {
        Calendar cal = new GregorianCalendar();
        int y = Integer.valueOf(year).intValue();
        int m = Integer.valueOf(month).intValue();
        cal.clear();//from  w w  w  .ja va  2s  .  c  om
        cal.set(y, m - 1, 1);
        cal.set(Calendar.DAY_OF_WEEK_IN_MONTH, Integer.valueOf(weekOfMonth)
                .intValue());
        cal.set(Calendar.DAY_OF_WEEK, Integer.valueOf(dayOfWeek).intValue());
        return cal.get(Calendar.DAY_OF_MONTH);
    }
}

Related

  1. getDateOffset(String date, int offset)
  2. getDateTomorrow(String date)
  3. getDayOfWeek(Date date)
  4. getDayOfWeek(String date)
  5. getDayOfWeek(String year, String month, String day)
  6. getDaysOfCurMonth()
  7. getDaysOfCurMonth(final String time)
  8. getMonth(Date date)
  9. getTomorrowAtEight()