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

U_STABLE int32_t U_EXPORT2 ucal_get ( const UCalendar cal,
UCalendarDateFields  field,
UErrorCode status 
)

Get the current value of a field from a UCalendar. All fields are represented as 32-bit integers.

Parameters:
calThe UCalendar to query.
fieldThe desired field; 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.
statusA pointer to an UErrorCode to receive any errors
Returns:
The value of the desired field.
See also:
ucal_set
ucal_isSet
ucal_clearField
ucal_clear ICU 2.0

Definition at line 403 of file ucal.cpp.

References U_FAILURE.

{

    if(U_FAILURE(*status)) return -1;

    return ((Calendar*)cal)->get(field, *status);
}

Generated by  Doxygen 1.6.0   Back to index