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

U_STABLE void U_EXPORT2 ucal_setGregorianChange ( UCalendar cal,
UDate  date,
UErrorCode pErrorCode 
)

Sets the GregorianCalendar change date. This is the point when the switch from Julian dates to Gregorian dates occurred. Default is 00:00:00 local time, October 15, 1582. Previous to this time and date will be Julian dates.

This function works only for Gregorian calendars. If the UCalendar is not an instance of a Gregorian calendar, then a U_UNSUPPORTED_ERROR error code is set.

Parameters:
calThe calendar object.
dateThe given Gregorian cutover date.
pErrorCodePointer to a standard ICU error code. Its input value must pass the U_SUCCESS() test, or else the function returns immediately. Check for U_FAILURE() on output or use with function chaining. (See User Guide for details.)
See also:
GregorianCalendar::setGregorianChange
ucal_getGregorianChange ICU 3.6

Definition at line 239 of file ucal.cpp.

References Calendar::getDynamicClassID(), GregorianCalendar::getStaticClassID(), U_FAILURE, and U_UNSUPPORTED_ERROR.

                                                                            {
    if(U_FAILURE(*pErrorCode)) {
        return;
    }
    Calendar *cpp_cal = (Calendar *)cal;
    if(cpp_cal->getDynamicClassID() != GregorianCalendar::getStaticClassID()) {
        *pErrorCode = U_UNSUPPORTED_ERROR;
        return;
    }
    ((GregorianCalendar *)cpp_cal)->setGregorianChange(date, *pErrorCode);
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index