13 #if !UCONFIG_NO_FORMATTING
201 #define UDAT_YEAR "y"
206 #define UDAT_QUARTER "QQQQ"
211 #define UDAT_ABBR_QUARTER "QQQ"
216 #define UDAT_YEAR_QUARTER "yQQQQ"
221 #define UDAT_YEAR_ABBR_QUARTER "yQQQ"
226 #define UDAT_MONTH "MMMM"
231 #define UDAT_ABBR_MONTH "MMM"
236 #define UDAT_NUM_MONTH "M"
241 #define UDAT_YEAR_MONTH "yMMMM"
246 #define UDAT_YEAR_ABBR_MONTH "yMMM"
251 #define UDAT_YEAR_NUM_MONTH "yM"
262 #define UDAT_YEAR_MONTH_DAY "yMMMMd"
268 #define UDAT_YEAR_ABBR_MONTH_DAY "yMMMd"
274 #define UDAT_YEAR_NUM_MONTH_DAY "yMd"
279 #define UDAT_WEEKDAY "EEEE"
284 #define UDAT_ABBR_WEEKDAY "E"
290 #define UDAT_YEAR_MONTH_WEEKDAY_DAY "yMMMMEEEEd"
296 #define UDAT_YEAR_ABBR_MONTH_WEEKDAY_DAY "yMMMEd"
302 #define UDAT_YEAR_NUM_MONTH_WEEKDAY_DAY "yMEd"
308 #define UDAT_MONTH_DAY "MMMMd"
314 #define UDAT_ABBR_MONTH_DAY "MMMd"
320 #define UDAT_NUM_MONTH_DAY "Md"
326 #define UDAT_MONTH_WEEKDAY_DAY "MMMMEEEEd"
332 #define UDAT_ABBR_MONTH_WEEKDAY_DAY "MMMEd"
338 #define UDAT_NUM_MONTH_WEEKDAY_DAY "MEd"
346 #define UDAT_HOUR "j"
351 #define UDAT_HOUR24 "H"
356 #define UDAT_MINUTE "m"
362 #define UDAT_HOUR_MINUTE "jm"
368 #define UDAT_HOUR24_MINUTE "Hm"
373 #define UDAT_SECOND "s"
380 #define UDAT_HOUR_MINUTE_SECOND "jms"
387 #define UDAT_HOUR24_MINUTE_SECOND "Hms"
393 #define UDAT_MINUTE_SECOND "ms"
404 #define UDAT_LOCATION_TZ "VVVV"
412 #define UDAT_GENERIC_TZ "vvvv"
420 #define UDAT_ABBR_GENERIC_TZ "v"
428 #define UDAT_SPECIFIC_TZ "zzzz"
436 #define UDAT_ABBR_SPECIFIC_TZ "z"
444 #define UDAT_ABBR_UTC_TZ "ZZZZ"
448 #ifndef U_HIDE_DEPRECATED_API
453 #define UDAT_STANDALONE_MONTH "LLLL"
458 #define UDAT_ABBR_STANDALONE_MONTH "LLL"
464 #define UDAT_HOUR_MINUTE_GENERIC_TZ "jmv"
469 #define UDAT_HOUR_MINUTE_TZ "jmz"
474 #define UDAT_HOUR_GENERIC_TZ "jv"
479 #define UDAT_HOUR_TZ "jz"
754 #ifndef U_HIDE_INTERNAL_API
822 const UChar *pattern,
823 int32_t patternLength,
845 #ifndef U_HIDE_DRAFT_API
876 #ifndef U_HIDE_DRAFT_API
907 #if U_SHOW_CPLUSPLUS_API
960 int32_t resultLength,
1087 #ifndef U_HIDE_DRAFT_API
1117 const UChar* fields,
1138 #ifndef U_HIDE_DRAFT_API
1221 int32_t resultLength,
1237 const UChar *pattern,
1238 int32_t patternLength);
1270 UDAT_STANDALONE_SHORT_MONTHS,
1271 UDAT_STANDALONE_NARROW_MONTHS,
1287 UDAT_STANDALONE_SHORT_QUARTERS,
1301 #ifndef U_HIDE_DRAFT_API
1366 int32_t symbolIndex,
1368 int32_t resultLength,
1405 int32_t symbolIndex,
1407 int32_t valueLength,
1435 #ifndef U_HIDE_DRAFT_API
1450 #ifndef U_HIDE_INTERNAL_API
1465 int32_t resultLength,
1482 int32_t resultLength,
1499 const UChar *datePattern,
1500 int32_t datePatternLength,
1501 const UChar *timePattern,
1502 int32_t timePatternLength,
1514 const UChar *pattern,
1515 int32_t patternLength,
int32_t udat_format(const UDateFormat *format, UDate dateToFormat, UChar *result, int32_t resultLength, UFieldPosition *position, UErrorCode *status)
Format a date using an UDateFormat.
void * UCalendar
A calendar.
FieldPosition and UFieldPosition selector for 'w' field alignment, corresponding to the UCAL_WEEK_OF_...
FieldPosition and UFieldPosition selector for 'e' field alignment, corresponding to the UCAL_DOW_LOCA...
The CLDR-style short weekday names, e.g.
Standalone context versions of months.
UCalendarDateFields
Possible fields in a UCalendar.
UBool udat_isLenient(const UDateFormat *fmt)
Determine if an UDateFormat will perform lenient parsing.
The localized characters.
FieldPosition and UFieldPosition selector for 'V' field alignment, corresponding to the UCAL_ZONE_OFF...
The CLDR-style format "narrow" weekday names, for example "M".
FieldPosition selector for "Q" field alignment, corresponding to quarters.
const UNumberFormat * udat_getNumberFormatForField(const UDateFormat *fmt, UChar field)
Get the UNumberFormat for specific field associated with an UDateFormat.
FieldPosition and UFieldPosition selector for 'M' field alignment, corresponding to the UCAL_MONTH fi...
void udat_adoptNumberFormat(UDateFormat *fmt, UNumberFormat *numberFormatToAdopt)
Adopt the UNumberFormat associated with an UDateFormat.
UBool udat_getBooleanAttribute(const UDateFormat *fmt, UDateFormatBooleanAttribute attr, UErrorCode *status)
Get a boolean attribute associated with a UDateFormat.
FieldPosition and UFieldPosition selector for 'k' field alignment, corresponding to the UCAL_HOUR_OF_...
const char * udat_getLocaleByType(const UDateFormat *fmt, ULocDataLocaleType type, UErrorCode *status)
Get the locale for this date format object.
The long era names, for example Anno Domini.
void udat_applyPatternRelative(UDateFormat *format, const UChar *datePattern, int32_t datePatternLength, const UChar *timePattern, int32_t timePatternLength, UErrorCode *status)
Set the date & time patterns used by a UDateFormat set for relative date formatting.
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols ...
The quarters, for example 1st Quarter.
void udat_registerOpener(UDateFormatOpener opener, UErrorCode *status)
Register a provider factory.
UDisplayContext
Display context settings.
double UDate
Date and Time data type.
The CLDR-style stand-alone "wide" weekday names.
FieldPosition selector for 'X' field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
void udat_setCalendar(UDateFormat *fmt, const UCalendar *calendarToSet)
Set the UCalendar associated with an UDateFormat.
The short month names, for example Feb.
#define U_INTERNAL
This is used to declare a function as an internal ICU C API.
Use the pattern given in the parameter to udat_open.
const UNumberFormat * udat_getNumberFormat(const UDateFormat *fmt)
Get the UNumberFormat associated with an UDateFormat.
count boolean date format constants
void udat_setLenient(UDateFormat *fmt, UBool isLenient)
Specify whether an UDateFormat will perform lenient parsing.
#define U_HIDE_INTERNAL_API
Define this to 1 to request that internal API be "hidden".
C API: Display context types (enum values)
FieldPosition and UFieldPosition selector for 'g' field alignment, corresponding to the UCAL_JULIAN_D...
const UCalendar * udat_getCalendar(const UDateFormat *fmt)
Get the UCalendar associated with an UDateFormat.
indicates tolerance of numeric data when String data may be assumed.
Bitfield for relative date.
FieldPosition and UFieldPosition selector for 'D' field alignment, corresponding to the UCAL_DAY_OF_Y...
FieldPosition selector for the "q" field alignment, corresponding to stand-alone quarters.
FieldPosition and UFieldPosition selector for 'u' field alignment, corresponding to the UCAL_EXTENDED...
FieldPosition and UFieldPosition selector for 'r' field alignment, no directly corresponding UCAL_ fi...
void udat_setSymbols(UDateFormat *format, UDateFormatSymbolType type, int32_t symbolIndex, UChar *value, int32_t valueLength, UErrorCode *status)
Set the symbols associated with an UDateFormat.
void udat_setNumberFormat(UDateFormat *fmt, const UNumberFormat *numberFormatToSet)
Set the UNumberFormat associated with an UDateFormat.
void udat_setContext(UDateFormat *fmt, UDisplayContext value, UErrorCode *status)
Set a particular UDisplayContext value in the formatter, such as UDISPCTX_CAPITALIZATION_FOR_STANDALO...
FieldPosition selector for 'c' field alignment, corresponding to the UCAL_DOW_LOCAL field...
UDisplayContext udat_getContext(const UDateFormat *fmt, UDisplayContextType type, UErrorCode *status)
Get the formatter's UDisplayContext value for the specified UDisplayContextType, such as UDISPCTX_TYP...
FieldPosition and UFieldPosition selector for 'd' field alignment, corresponding to the UCAL_DATE fie...
void udat_close(UDateFormat *format)
Close a UDateFormat.
indicates tolerance of pattern mismatch between input data and specified format pattern.
FieldPosition and UFieldPosition selector for 'Y' field alignment, corresponding to the UCAL_YEAR_WOY...
void udat_set2DigitYearStart(UDateFormat *fmt, UDate d, UErrorCode *status)
Set the year relative to which all 2-digit years will be interpreted.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
UDateFormat *(* UDateFormatOpener)(UDateFormatStyle timeStyle, UDateFormatStyle dateStyle, const char *locale, const UChar *tzID, int32_t tzIDLength, const UChar *pattern, int32_t patternLength, UErrorCode *status)
FieldPosition and UFieldPosition selector for 'F' field alignment, corresponding to the UCAL_DAY_OF_W...
UDateFormatSymbolType
The possible types of date format symbols.
The CLDR-style stand-alone "narrow" weekday names.
The month names, for example February.
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
void * UNumberFormat
A number formatter.
A struct representing a range of text containing a specific field.
FieldPosition selector for 'O' field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
FieldPosition and UFieldPosition selector for 'A' field alignment, corresponding to the UCAL_MILLISEC...
indicates whether whitespace is allowed.
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
void * UDateFormat
A date formatter.
int32_t udat_toPatternRelativeDate(const UDateFormat *fmt, UChar *result, int32_t resultLength, UErrorCode *status)
Extract the date pattern from a UDateFormat set for relative date formatting.
FieldPosition and UFieldPosition selector for 'v' field alignment, corresponding to the UCAL_ZONE_OFF...
The era names, for example AD.
Cyclic year names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols not ...
FieldPosition and UFieldPosition selector for 'W' field alignment, corresponding to the UCAL_WEEK_OF_...
The CLDR-style format "wide" weekday names, for example Monday.
UCalendarDateFields udat_toCalendarDateField(UDateFormatField field)
Maps from a UDateFormatField to the corresponding UCalendarDateFields.
struct UDateFormatSymbols UDateFormatSymbols
Date format symbols.
UDateFormatStyle
The possible date/time format styles.
UDate udat_parse(const UDateFormat *format, const UChar *text, int32_t textLength, int32_t *parsePos, UErrorCode *status)
Parse a string into an date/time using a UDateFormat.
UDateFormat * udat_open(UDateFormatStyle timeStyle, UDateFormatStyle dateStyle, const char *locale, const UChar *tzID, int32_t tzIDLength, const UChar *pattern, int32_t patternLength, UErrorCode *status)
Open a new UDateFormat for formatting and parsing dates and times.
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols ...
void udat_applyPattern(UDateFormat *format, UBool localized, const UChar *pattern, int32_t patternLength)
Set the pattern used by an UDateFormat.
FieldPosition and UFieldPosition selector for 'E' field alignment, corresponding to the UCAL_DAY_OF_W...
int32_t udat_toPattern(const UDateFormat *fmt, UBool localized, UChar *result, int32_t resultLength, UErrorCode *status)
Extract the pattern from a UDateFormat.
FieldPosition and UFieldPosition selector for 'a' field alignment, corresponding to the UCAL_AM_PM fi...
The short quarter names, for example Q1.
Cyclic year names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols not ...
FieldPosition and UFieldPosition selector for 'K' field alignment, corresponding to the UCAL_HOUR fie...
const char * udat_getAvailable(int32_t localeIndex)
Get a locale for which date/time formatting patterns are available.
indicates tolerance of a partial literal match
int32_t udat_getSymbols(const UDateFormat *fmt, UDateFormatSymbolType type, int32_t symbolIndex, UChar *result, int32_t resultLength, UErrorCode *status)
Get the symbols associated with an UDateFormat.
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
UDisplayContextType
Display context types, for getting values of a particular setting.
void udat_adoptNumberFormatForFields(UDateFormat *fmt, const UChar *fields, UNumberFormat *numberFormatToSet, UErrorCode *status)
Set the UNumberFormat for specific field associated with an UDateFormat.
void udat_setBooleanAttribute(UDateFormat *fmt, UDateFormatBooleanAttribute attr, UBool newValue, UErrorCode *status)
Set a boolean attribute associated with a UDateFormat.
Standalone context versions of quarters.
UDateFormatField
FieldPosition and UFieldPosition selectors for format fields defined by DateFormat and UDateFormat...
FieldPosition and UFieldPosition selector for 'G' field alignment, corresponding to the UCAL_ERA fiel...
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
UDateFormat * udat_clone(const UDateFormat *fmt, UErrorCode *status)
Open a copy of a UDateFormat.
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested...
FieldPosition and UFieldPosition selector for 'm' field alignment, corresponding to the UCAL_MINUTE f...
int32_t udat_countSymbols(const UDateFormat *fmt, UDateFormatSymbolType type)
Count the number of particular symbols for an UDateFormat.
The CLDR-style stand-alone "abbreviated" (not "short") weekday names.
The narrow month names, for example F.
Cyclic year names (only supported for some calendars, and only for FORMAT usage)
FieldPosition selector for 'x' field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
FieldPosition and UFieldPosition selector for 's' field alignment, corresponding to the UCAL_SECOND f...
Basic definitions for ICU, for both C and C++ APIs.
The CLDR-style format "abbreviated" (not "short") weekday names, for example "Mon." For the CLDR-style format "short" weekday names, use UDAT_SHORTER_WEEKDAYS.
FieldPosition and UFieldPosition selector for 'z' field alignment, corresponding to the UCAL_ZONE_OFF...
FieldPosition and UFieldPosition selector for 'y' field alignment, corresponding to the UCAL_YEAR fie...
FieldPosition selector for 'L' field alignment, corresponding to the UCAL_MONTH field.
The AM/PM names, for example AM.
Number of FieldPosition and UFieldPosition selectors for DateFormat and UDateFormat.
int32_t udat_toPatternRelativeTime(const UDateFormat *fmt, UChar *result, int32_t resultLength, UErrorCode *status)
Extract the time pattern from a UDateFormat set for relative date formatting.
FieldPosition and UFieldPosition selector for 'Z' field alignment, corresponding to the UCAL_ZONE_OFF...
UDate udat_get2DigitYearStart(const UDateFormat *fmt, UErrorCode *status)
Get the year relative to which all 2-digit years are interpreted.
int32_t udat_countAvailable(void)
Determine how many locales have date/time formatting patterns available.
#define U_DRAFT
This is used to declare a function as a draft public ICU C API.
FieldPosition and UFieldPosition selector for 'H' field alignment, corresponding to the UCAL_HOUR_OF_...
UDateFormatBooleanAttribute
DateFormat boolean attributes.
FieldPosition and UFieldPosition selector for 'S' field alignment, corresponding to the UCAL_MILLISEC...
FieldPosition and UFieldPosition selector for 'h' field alignment, corresponding to the UCAL_HOUR fie...
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage) ...
UDateFormatOpener udat_unregisterOpener(UDateFormatOpener opener, UErrorCode *status)
Un-Register a provider factory.
FieldPosition selector for "U" field alignment, corresponding to cyclic year names.
void udat_parseCalendar(const UDateFormat *format, UCalendar *calendar, const UChar *text, int32_t textLength, int32_t *parsePos, UErrorCode *status)
Parse a string into an date/time using a UDateFormat.
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
int8_t UBool
The ICU boolean type.
Standalone version of UDAT_SHORTER_WEEKDAYS.