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

Method addYear

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

Returns a timestamp relative to this one by the given number of years. The day field may be adjusted to account for leap days. For example, adding one year to 2012-02-29 results in 2013-02-28. @param amount a number of years.

(int amount)

Source from the content-addressed store, hash-verified

2659 * @param amount a number of years.
2660 */
2661 public final Timestamp addYear(int amount)
2662 {
2663 if (amount == 0) return this;
2664
2665 Calendar cal = calendarValue();
2666 cal.add(Calendar.YEAR, amount);
2667 return new Timestamp(cal, _precision, _fraction, _offset);
2668 }
2669
2670
2671 //=========================================================================

Callers 5

adjustYearMethod · 0.95
invokeMethod · 0.80

Calls 2

calendarValueMethod · 0.95
addMethod · 0.65

Tested by 4

invokeMethod · 0.64