Java Day of Week getNextWeekDay(Date startDate, int day)

Here you can find the source of getNextWeekDay(Date startDate, int day)

Description

get Next Week Day

License

Apache License

Declaration

public static Date getNextWeekDay(Date startDate, int 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 Date getNextWeekDay(Date startDate, int day) {

        Calendar strDate = Calendar.getInstance();

        strDate.setFirstDayOfWeek(Calendar.MONDAY);
        strDate.setTime(startDate);/* w w  w  .j  a v a 2 s . c o  m*/
        strDate.add(Calendar.WEEK_OF_YEAR, 1);
        strDate.set(Calendar.DAY_OF_WEEK, day);
        return strDate.getTime();
    }
}

Related

  1. getMondayOfWeek(Date date)
  2. getNext(final java.util.Date date, final int dayofweek)
  3. getNextClosestDateTime(DayOfWeek[] daysOfWeek, int hour, int min)
  4. getNextClosestDateTime(DayOfWeek[] daysOfWeek, int hour, int min)
  5. getNextDay(long date, int startOfWeek)
  6. getSatDayOfWeek(Date date)
  7. getScheduledDate(int dayOfWeek, int hourOfDay, int minute, int second)
  8. getSeqWeek(String date)
  9. getSeqWeekByMonth(Date currDate)