java localdate subtract two dates
@Test
public void givenTwoDatesInJava8_whenDifferentiating_thenWeGetSix() {
LocalDate now = LocalDate.now();
LocalDate sixDaysBehind = now.minusDays(6);
Period period = Period.between(now, sixDaysBehind);
int diff = period.getDays();
assertEquals(diff, 6);
}
Also in Java:
- how lock horizontal orientation android
- number to string java
- java stack methods
- leap year checker java
- java script find screen size of device
- how to end a program in an if statement java
- java define custom exception
- java foreach map
- teimpo en segundos java
- binary string to int java
- how to read in a file in java
- java how to program
- how to remove a certain string in a arraylist java
- how to remove all special characters from a string in java
- Enums injava
- dictionary in java
- jtable fill panel
- enum with numbers java
- java function that returns the index of the largest value in an array
- never gonna give you up
- spigot respawn player location
- how to use lambda in java
- capitalize string java
- run static method java