Open a UCalendar. A UCalendar may be used to convert a millisecond value to a year, month, and day. Note: When unknown TimeZone ID is specified, the UCalendar returned by the function is initialized with GMT ("Etc/GMT") without any errors/warnings. If you want to check if a TimeZone ID is valid, use ucal_getCanonicalTimeZoneID prior to this function.
Definition at line 120 of file ucal.cpp. References TimeZone::createDefault(), Calendar::createInstance(), NULL, U_FAILURE, and UCAL_GREGORIAN. { if(U_FAILURE(*status)) return 0; TimeZone* zone = (zoneID==NULL) ? TimeZone::createDefault() : _createTimeZone(zoneID, len, status); if (U_FAILURE(*status)) { return NULL; } if ( caltype == UCAL_GREGORIAN ) { char localeBuf[ULOC_LOCALE_IDENTIFIER_CAPACITY]; uprv_strncpy(localeBuf, locale, ULOC_LOCALE_IDENTIFIER_CAPACITY); uloc_setKeywordValue("calendar", "gregorian", localeBuf, ULOC_LOCALE_IDENTIFIER_CAPACITY, status); if (U_FAILURE(*status)) { return NULL; } return (UCalendar*)Calendar::createInstance(zone, Locale(localeBuf), *status); } return (UCalendar*)Calendar::createInstance(zone, Locale(locale), *status); }
Here is the call graph for this function:
![]() |