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

U_STABLE UDate U_EXPORT2 ucal_getGregorianChange ( const UCalendar cal,
UErrorCode pErrorCode 
)

Gets the Gregorian Calendar 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.
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.)
Returns:
The Gregorian cutover time for this calendar.
See also:
GregorianCalendar::getGregorianChange
ucal_setGregorianChange ICU 3.6

Definition at line 252 of file ucal.cpp.

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

                                                                      {
    if(U_FAILURE(*pErrorCode)) {
        return (UDate)0;
    }
    Calendar *cpp_cal = (Calendar *)cal;
    if(cpp_cal->getDynamicClassID() != GregorianCalendar::getStaticClassID()) {
        *pErrorCode = U_UNSUPPORTED_ERROR;
        return (UDate)0;
    }
    return ((GregorianCalendar *)cpp_cal)->getGregorianChange();
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index