Calendar.add

Calendar.add

Class Overview | Class Members | This Package | All Packages

Syntax
public abstract void add( int field, int amount )
Parameters
field
the time field.
amount
the amount of date or time to be added to the field.
Description
Date Arithmetic function. Adds the specified (signed) amount of time to the given time field, based on the calendar's rules. For example, to subtract 5 days from the current time of the calendar, you can achieve it by calling:

add(Calendar.DATE, -5).