I was writing some test cases for some convenience methods that I am updating and decided to see what would happen if I used LocalDate
's isLeapYear()
method on the year 0. As I understand it, year 0 never actually existed: the year before 1 AD was 1 BC. (This is based on an article I read many years ago whose source I have long forgotten.) Much to my surprise, my test indicated that the year 0 wa a leap year!
I realize that the java.time.LocalDate
class implements ISO-8601 but does ISO-8601 really indicate that the year 0 existed? I'm reluctant to believe that the people who tested LocalDate
would have missed this as a test case but I'm also reluctant to believe that an international standard like ISO-8601 would make such an obvious mistake.
The other possibility is that the article I read was just flat-out wrong. (Or it was correct then but was rethought later.)
This is not hugely important but I am curious to know where the mistake is: ISO-8601, Java's LocalDate
class, or my understanding of how time is reckoned.