Java LocalDate Calculate calcNextDayOfWeek(LocalDate d, DayOfWeek dow)

Here you can find the source of calcNextDayOfWeek(LocalDate d, DayOfWeek dow)

Description

Find the next day of the week from the given LocalDate

License

Open Source License

Parameter

Parameter Description
d a parameter
dow a parameter

Declaration


public static LocalDate calcNextDayOfWeek(LocalDate d, DayOfWeek dow) throws Exception 

Method Source Code


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

import java.time.*;

import java.time.temporal.TemporalAdjusters;

public class Main {
    /**/*from  ww  w.  ja  va2s .  c  om*/
     * Find the next day of the week from the given LocalDate
     *
     * @param d
     * @param dow
     * @return
     */

    public static LocalDate calcNextDayOfWeek(LocalDate d, DayOfWeek dow) throws Exception {
        return d.with(TemporalAdjusters.next(dow));
    }
}

Related

  1. adjustDate(final LocalDate contextDate, String str, final boolean add)
  2. asDate(LocalDate date)
  3. asEpochMilli(final LocalDate localDate)
  4. atEndOfDay(LocalDate date)
  5. before(final LocalDate d1, final LocalDate d2)
  6. calculateAge(LocalDate birthDate, LocalDate currentDate)
  7. changeDateToLocalDate(Date value)
  8. convert(LocalDate ld)
  9. convertDatabaseDateToUS(LocalDate databaseDate)