MCPcopy Create free account
hub / github.com/amazon-ion/ion-java / addMonth

Method addMonth

src/main/java/com/amazon/ion/Timestamp.java:2633–2637  ·  view source on GitHub ↗

Returns a timestamp relative to this one by the given number of months. The day field may be adjusted to account for different month length and leap days. For example, adding one month to 2011-01-31 results in 2011-02-28. @param amount a number of months.

(int amount)

Source from the content-addressed store, hash-verified

2631 * @param amount a number of months.
2632 */
2633 public final Timestamp addMonth(int amount)
2634 {
2635 if (amount == 0 && _precision.includes(Precision.MONTH)) return this;
2636 return addMonthForPrecision(amount, _precision.includes(Precision.MONTH) ? _precision : Precision.MONTH);
2637 }
2638
2639 /**
2640 * Returns a timestamp relative to this one by the given number of years.

Calls 2

addMonthForPrecisionMethod · 0.95
includesMethod · 0.45

Tested by 4

invokeMethod · 0.64