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)
| 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 | //========================================================================= |