Logo Search packages:      
Sourcecode: icu version File versions  Download package

void Calendar::add ( EDateFields  field,
int32_t  amount,
UErrorCode status 
) [virtual, inherited]

UDate 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, call add(Calendar::DATE, -5). When adding on the month or Calendar::MONTH field, other fields like date might conflict and need to be changed. For instance, adding 1 month on the date 01/31/96 will result in 02/29/96.

field Specifies which date field to modify.
amount The amount of time to be added to the field, in the natural unit for that field (e.g., days for the day fields, hours for the hour field.)
status Output param set to success/failure code on exit. If any value previously set in the time field is invalid or restricted by leniency, this will be set to an error status.
ICU 2.6. use add(UCalendarDateFields field, int32_t amount, UErrorCode& status) instead.

Reimplemented in ChineseCalendar, and HebrewCalendar.

Definition at line 1771 of file calendar.cpp.

Referenced by HebrewCalendar::add(), ChineseCalendar::add(), Calendar::getActualHelper(), CalendarRegressionTest::getAssociatedDate(), initializeSystemDefaultCentury(), PersianCalendar::initializeSystemDefaultCentury(), IslamicCalendar::initializeSystemDefaultCentury(), IndianCalendar::initializeSystemDefaultCentury(), GregorianCalendar::initializeSystemDefaultCentury(), EthiopicCalendar::initializeSystemDefaultCentury(), CopticCalendar::initializeSystemDefaultCentury(), BuddhistCalendar::initializeSystemDefaultCentury(), RelativeDateFormat::parse(), CalendarRegressionTest::test4040996(), CalendarRegressionTest::test4061476(), CalendarRegressionTest::test4073929(), CalendarRegressionTest::test4096539(), CalendarRegressionTest::test4103271(), CalendarRegressionTest::test4114578(), CalendarRegressionTest::test4125892(), CalendarRegressionTest::Test4165343(), CalendarRegressionTest::Test4197699(), CalendarRegressionTest::TestJ438(), CalendarRegressionTest::TestJ81(), CalendarRegressionTest::TestTimeZoneTransitionAdd(), and CalendarRegressionTest::TestWeekShift().

    Calendar::add((UCalendarDateFields)field, amount, status);

Generated by  Doxygen 1.6.0   Back to index