Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.time.LocalDate;
- import java.time.temporal.ChronoUnit;
- public class WhyChronoUnitReturnsLong {
- @org.junit.Test
- public void test() {
- LocalDate min = LocalDate.MIN;
- LocalDate max = LocalDate.MAX;
- long monthBetween = ChronoUnit.MONTHS.between(min, max);
- int intMaxValue = Integer.MAX_VALUE;
- System.out.println("min = " + min);
- // -999999999-01-01
- System.out.println("max = " + max);
- // +999999999-12-31
- System.out.println("monthBetween = " + monthBetween);
- // 23999999987
- System.out.println("intMaxValue = " + intMaxValue);
- // 2147483647
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement