Last active
September 12, 2015 17:51
-
-
Save robsongomes/89f364fcd58adee40060 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.time.DayOfWeek; | |
import java.time.LocalDate; | |
import java.time.temporal.TemporalAdjusters; | |
public class TemporalAdjustersTeste { | |
public static void main(String[] args) { | |
LocalDate primeiroSetembro = LocalDate.of(2015, 9, 1); | |
//Primeira 2ª de Setembro | |
LocalDate primeiraSegunda = primeiroSetembro | |
.with(TemporalAdjusters.firstInMonth(DayOfWeek.MONDAY)); | |
System.out.println(primeiraSegunda); | |
//Primeira 2ª de Outubro | |
System.out.println(primeiraSegunda | |
.plusMonths(1) | |
.with(TemporalAdjusters.firstInMonth(DayOfWeek.MONDAY))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment