DateMath is broken before the year 1582

Details

Description

In Solr 6.0, dates are parsed using the Java 8 java.time API. It formerly was parsed using java.util.SimpleDateFormat which uses java.util.GregorianCalendar. I've learned that the java.time API does not switch to a different algorithm at the Gregorian Change Date (year 1582) whereas GregorianCalendar does. A ramification of this is that the milliseconds before epoch value is different between the APIs for dates prior to this year. They both round-trip between themselves but not between each other prior to this date. Thus, anyone indexing historical dates must re-index when moving to Solr 6.

This weirdness will show itself for units at the year or month level, but not below that (from what I'm seeing). In other words, if facet.range.gap is at this amount, or otherwise using the date math syntax to round or add a year or month, there will be issues like this. Otherwise there doesn't seem to be an issue.

I think the solution is clearly to switch the date math code to use the java.time API.