July 2017
Intermediate to advanced
466 pages
11h 24m
English
Period is a date-based unit of time. Whereas Duration was about time (hours, minutes, seconds, and so on), Period is about years, weeks, months, and so forth. Like Duration, it exposes several arithmetic methods to add and subtract, though these deal with years, months, and days. It also offers plus(long amount, TemporalUnit unit) (and the equivalent minus) as well.
Also, like Duration, Period has a parse() method, which also takes an ISO-8601 format that looks like this--PnYnMnD and PnW. Based on the discussion earlier, the structure is probably pretty obvious:
Read now
Unlock full access