Created
July 9, 2015 18:23
-
-
Save Yogu/472ce6886b4e949734cc 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 org.joda.time.LocalDate; | |
import org.joda.time.Years; | |
public class DateTest { | |
public static void main(String[] args) { | |
LocalDate start = LocalDate.parse("2012-01-28"); // leap year | |
LocalDate end = LocalDate.parse("2013-01-27"); | |
LocalDate end2 = LocalDate.parse("2013-01-28"); | |
System.out.println(end.isBefore(start.plus(Years.ONE))); // true | |
System.out.println(end2.isBefore(start.plus(Years.ONE))); // false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment