Advertisement
Guest User

Untitled

a guest
Jan 27th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import java.time.LocalDate;
  2. import java.time.temporal.ChronoUnit;
  3.  
  4. public class WhyChronoUnitReturnsLong {
  5.  
  6. @org.junit.Test
  7. public void test() {
  8.  
  9. LocalDate min = LocalDate.MIN;
  10. LocalDate max = LocalDate.MAX;
  11.  
  12. long monthBetween = ChronoUnit.MONTHS.between(min, max);
  13. int intMaxValue = Integer.MAX_VALUE;
  14.  
  15. System.out.println("min = " + min);
  16. // -999999999-01-01
  17. System.out.println("max = " + max);
  18. // +999999999-12-31
  19. System.out.println("monthBetween = " + monthBetween);
  20. // 23999999987
  21. System.out.println("intMaxValue = " + intMaxValue);
  22. // 2147483647
  23.  
  24. }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement