rollYear()
Adds the specified (signed) amount to the Year
field, without changing larger fields.
Syntax
Calendar rollYear(Numeric amount)
- amount is the signed amount to add to the
Year
field.
Usage
For example, to roll the current date up by a year, you can achieve this by calling
rollYear(1)
. When rolling on the Year field, it will roll the year value in the
range between 1 and the value returned by calling getMaximumYear()
.