public final class Months extends SingleUnitTimeSpan<CalendarUnit,Months>
Represents a time span in gregorian months.
TimeSpan.Item<U>| Modifier and Type | Field and Description |
|---|---|
static Months |
ONE
Constant for exactly one gregorian month.
|
static Months |
ZERO
Constant for zero gregorian months.
|
| Modifier and Type | Method and Description |
|---|---|
static Months |
between(CalendarMonth m1,
CalendarMonth m2)
Determines the difference in months between given calendar months.
|
static <T extends TimePoint<? super CalendarUnit,T>> |
between(T t1,
T t2)
Determines the temporal distance between given dates/time-points in gregorian months.
|
static Months |
of(int months)
Obtains a time span in given gregorian months.
|
static Months |
parsePeriod(String period)
Parses the canonical ISO-8601-format "PnM" with possible preceding minus-char.
|
abs, addTo, compareTo, contains, equals, getAmount, getPartialAmount, getTotalLength, getUnit, hashCode, inverse, isEmpty, isNegative, isPositive, minus, minus, multipliedBy, plus, plus, subtractFrom, toStdDuration, toStringpublic static final Months ZERO
Constant for zero gregorian months.
public static final Months ONE
Constant for exactly one gregorian month.
public static Months of(int months)
Obtains a time span in given gregorian months.
months - count of gregorian months, maybe negativeCalendarUnit.MONTHSpublic static <T extends TimePoint<? super CalendarUnit,T>> Months between(T t1, T t2)
Determines the temporal distance between given dates/time-points in gregorian months.
T - generic type of time-pointst1 - first time-pointt2 - second time-pointPlainDate,
PlainTimestamppublic static Months between(CalendarMonth m1, CalendarMonth m2)
Determines the difference in months between given calendar months.
m1 - first calendar monthm2 - second calendar monthpublic static Months parsePeriod(String period) throws ParseException
Parses the canonical ISO-8601-format "PnM" with possible preceding minus-char.
period - the formatted string to be parsedParseException - if given argument cannot be parsedCopyright © 2014–2018. All rights reserved.