ThreeTen-Extra is a small library that builds on the Java SE 8 java.time package.
The additional value types operate exactly as per similar classes in Java SE 8. These include:
- DayOfMonth - a day-of-month without month or year
- DayOfYear - a day-of-year without year
- AmPm - before or after midday
- Quarter - the four quarters, Q1, Q2, Q3 and Q4
- YearQuarter - combines a year and quarter, 2014-Q4
- YearWeek - combines a week-based-year and a week, 2014-W06
- Days - an amount of time measured in days
- Weeks - an amount of time measured in weeks
- Months - an amount of time measured in months
- Years - an amount of time measured in years
- Interval - an interval between two instants
- PeriodDuration - combines a Period and a Duration
The additional calendar systems operate exactly as per similar classes in Java SE 8. These include:
The JDK operates exclusively using the Java time-scale, defined in Instant. That time-scale eliminates leap seconds using UTC-SLS, although the JDK implementation is typically based on a POSIX-like clock (and thus relatively undefined around leap seconds).
ThreeTen-Extra provides the additional classes that were rejected from JDK 8. They were not included as they were deemed to be too specialized for the JDK.
Use TaiInstant if you need an instant using the TAI time-scale.
Use UtcInstant if you need an instant using the UTC time-scale.
The leap second data is provided in a text file loaded from the classpath. Only whole leap seconds are handled, and data starts from 1972 by default. To replace the built in leap seconds file, create a file META-INF/org/threeten/extra/scale/LeapSeconds.txt. The content should have two columns as per this format.