Temporal Adjusters Business Dates

TemporalAdjusters turns business rules like next Friday, last day of month, or first Monday into single with() calls on immutable LocalDate values.

JavaData Integrity

Code

snippet
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.temporal.TemporalAdjusters;

public class PayrollDates {

    public static void main(String[] args) {
        LocalDate today = LocalDate.of(2026, 11, 14);

        System.out.println("month start:  " + today.with(TemporalAdjusters.firstDayOfMonth()));
        System.out.println("month end:    " + today.with(TemporalAdjusters.lastDayOfMonth()));
        System.out.println("next friday:  " + today.with(TemporalAdjusters.next(DayOfWeek.FRIDAY)));
        System.out.println("prev or same: " + today.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)));
        System.out.println("first monday: " + today.with(TemporalAdjusters.firstInMonth(DayOfWeek.MONDAY)));
        System.out.println("year end:     " + today.with(TemporalAdjusters.lastDayOfYear()));
    }
}

How it works

Count the class PayrollDates and the function main as the entire surface area of Temporal Adjusters Business Dates.

Using it

Running the file prints labeled results such as month start:, month end:, next friday: — each operation’s effect is visible in the output.

Key statements

LocalDate today = LocalDate.of(2026, 11, 14);

Interactive Tools for This Topic

FAQ

What does Temporal Adjusters Business Dates print when run?
Run it as a complete program — the output lines carry labels such as `month start:`, `month end:`, `next friday:`.