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

U_STABLE void U_EXPORT2 ucal_add ( UCalendar cal,
UCalendarDateFields  field,
int32_t  amount,
UErrorCode status 
)

Add a specified signed amount to a particular field in a UCalendar. This can modify more significant fields in the calendar.

Parameters:
calThe UCalendar to which to add.
fieldThe field to which to add the signed value; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH, UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK, UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND, UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET.
amountThe signed amount to add to field. If the amount causes the value to exceed to maximum or minimum values for that field, other fields are modified to preserve the magnitude of the change.
statusA pointer to an UErrorCode to receive any errors
See also:
ucal_roll ICU 2.0

Definition at line 379 of file ucal.cpp.

References U_FAILURE.

{

    if(U_FAILURE(*status)) return;

    ((Calendar*)cal)->add(field, amount, *status);
}

Generated by  Doxygen 1.6.0   Back to index