An immutable period consisting of the standard year, month, day, hour, minute, second and nanosecond units.
This is used to represent the human-scale description of an amount of time, known as a period. As an example, "3 months, 4 days and 7 hours" can be stored.
Period stores just six units - years, months, days, hours, minutes and seconds. Certain methods have an implied relationship between some of these units:
- 12 months in a year
- 24 hours in a day (ignoring time zones)
- 60 minutes in an hour
- 60 seconds in a minute
- 1,000,000,000 nanoseconds in a second
Period can be used to store data for use by any calendar system. However, those methods which make the assumptions above will only be valid for use if the calendar system matches the assumptions.
Note that beyond the limits specified above, the stored amounts are only descriptive. For example, a year in two calendar systems may differ in length. Only when the period is combined with a date/time in a specific calendar system can the duration of the period be calculated.
Period is immutable and thread-safe.
@author Stephen Colebourne