15 #if !UCONFIG_NO_FORMATTING
22 #if U_SHOW_CPLUSPLUS_API
24 #endif // U_SHOW_CPLUSPLUS_API
208 #define UDAT_YEAR "y"
213 #define UDAT_QUARTER "QQQQ"
218 #define UDAT_ABBR_QUARTER "QQQ"
223 #define UDAT_YEAR_QUARTER "yQQQQ"
228 #define UDAT_YEAR_ABBR_QUARTER "yQQQ"
233 #define UDAT_MONTH "MMMM"
238 #define UDAT_ABBR_MONTH "MMM"
243 #define UDAT_NUM_MONTH "M"
248 #define UDAT_YEAR_MONTH "yMMMM"
253 #define UDAT_YEAR_ABBR_MONTH "yMMM"
258 #define UDAT_YEAR_NUM_MONTH "yM"
269 #define UDAT_YEAR_MONTH_DAY "yMMMMd"
275 #define UDAT_YEAR_ABBR_MONTH_DAY "yMMMd"
281 #define UDAT_YEAR_NUM_MONTH_DAY "yMd"
286 #define UDAT_WEEKDAY "EEEE"
291 #define UDAT_ABBR_WEEKDAY "E"
297 #define UDAT_YEAR_MONTH_WEEKDAY_DAY "yMMMMEEEEd"
303 #define UDAT_YEAR_ABBR_MONTH_WEEKDAY_DAY "yMMMEd"
309 #define UDAT_YEAR_NUM_MONTH_WEEKDAY_DAY "yMEd"
315 #define UDAT_MONTH_DAY "MMMMd"
321 #define UDAT_ABBR_MONTH_DAY "MMMd"
327 #define UDAT_NUM_MONTH_DAY "Md"
333 #define UDAT_MONTH_WEEKDAY_DAY "MMMMEEEEd"
339 #define UDAT_ABBR_MONTH_WEEKDAY_DAY "MMMEd"
345 #define UDAT_NUM_MONTH_WEEKDAY_DAY "MEd"
353 #define UDAT_HOUR "j"
358 #define UDAT_HOUR24 "H"
363 #define UDAT_MINUTE "m"
369 #define UDAT_HOUR_MINUTE "jm"
375 #define UDAT_HOUR24_MINUTE "Hm"
380 #define UDAT_SECOND "s"
387 #define UDAT_HOUR_MINUTE_SECOND "jms"
394 #define UDAT_HOUR24_MINUTE_SECOND "Hms"
400 #define UDAT_MINUTE_SECOND "ms"
411 #define UDAT_LOCATION_TZ "VVVV"
419 #define UDAT_GENERIC_TZ "vvvv"
427 #define UDAT_ABBR_GENERIC_TZ "v"
435 #define UDAT_SPECIFIC_TZ "zzzz"
443 #define UDAT_ABBR_SPECIFIC_TZ "z"
451 #define UDAT_ABBR_UTC_TZ "ZZZZ"
455 #ifndef U_HIDE_DEPRECATED_API
460 #define UDAT_STANDALONE_MONTH "LLLL"
465 #define UDAT_ABBR_STANDALONE_MONTH "LLL"
471 #define UDAT_HOUR_MINUTE_GENERIC_TZ "jmv"
476 #define UDAT_HOUR_MINUTE_TZ "jmz"
481 #define UDAT_HOUR_GENERIC_TZ "jv"
486 #define UDAT_HOUR_TZ "jz"
489 #ifndef U_HIDE_INTERNAL_API
495 #define JP_ERA_2019_ROOT "Reiwa"
501 #define JP_ERA_2019_JA "\\u4EE4\\u548C"
507 #define JP_ERA_2019_NARROW "R"
508 #endif // U_HIDE_INTERNAL_API
782 #ifndef U_HIDE_INTERNAL_API
803 UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36,
805 #ifndef U_HIDE_INTERNAL_API
815 #ifndef U_HIDE_DEPRECATED_API
827 #ifndef U_HIDE_INTERNAL_API
833 #define UDAT_HAS_PATTERN_CHAR_FOR_TIME_SEPARATOR 0
897 const UChar *pattern,
898 int32_t patternLength,
944 #ifndef U_FORCE_HIDE_DEPRECATED_API
950 #endif // U_FORCE_HIDE_DEPRECATED_API
1009 #if U_SHOW_CPLUSPLUS_API
1062 int32_t resultLength,
1127 int32_t resultLength,
1322 const UChar* fields,
1361 U_CAPI const char* U_EXPORT2
1420 int32_t resultLength,
1436 const UChar *pattern,
1437 int32_t patternLength);
1469 UDAT_STANDALONE_SHORT_MONTHS,
1470 UDAT_STANDALONE_NARROW_MONTHS,
1486 UDAT_STANDALONE_SHORT_QUARTERS,
1562 int32_t symbolIndex,
1564 int32_t resultLength,
1601 int32_t symbolIndex,
1603 int32_t valueLength,
1615 U_CAPI const char* U_EXPORT2
1643 #ifndef U_HIDE_INTERNAL_API
1658 int32_t resultLength,
1675 int32_t resultLength,
1692 const UChar *datePattern,
1693 int32_t datePatternLength,
1694 const UChar *timePattern,
1695 int32_t timePatternLength,
1707 const UChar *pattern,
1708 int32_t patternLength,
U_CAPI void udat_setContext(UDateFormat *fmt, UDisplayContext value, UErrorCode *status)
Set a particular UDisplayContext value in the formatter, such as UDISPCTX_CAPITALIZATION_FOR_STANDALO...
void * UCalendar
A calendar.
FieldPosition and UFieldPosition selector for 'w' field alignment, corresponding to the UCAL_WEEK_OF_...
FieldPosition selector for 'b' field alignment.
U_CAPI int32_t udat_formatForFields(const UDateFormat *format, UDate dateToFormat, UChar *result, int32_t resultLength, UFieldPositionIterator *fpositer, UErrorCode *status)
Format a date using a UDateFormat.
U_CAPI 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.
U_CAPI 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 'e' field alignment, corresponding to the UCAL_DOW_LOCA...
The CLDR-style short weekday names, e.g.
U_CAPI void udat_applyPattern(UDateFormat *format, UBool localized, const UChar *pattern, int32_t patternLength)
Set the pattern used by an UDateFormat.
Standalone context versions of months.
UCalendarDateFields
Possible fields in a UCalendar.
U_CAPI int32_t udat_formatCalendarForFields(const UDateFormat *format, UCalendar *calendar, UChar *result, int32_t capacity, UFieldPositionIterator *fpositer, UErrorCode *status)
Format a date using a UDateFormat.
indicates tolerance of a partial literal match e.g.
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".
#define U_CAPI
This is used to declare a function as a public ICU C API.
FieldPosition selector for "Q" field alignment, corresponding to quarters.
U_CAPI 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.
FieldPosition and UFieldPosition selector for 'M' field alignment, corresponding to the UCAL_MONTH fi...
U_CAPI const char * udat_getLocaleByType(const UDateFormat *fmt, ULocDataLocaleType type, UErrorCode *status)
Get the locale for this date format object.
U_CAPI int32_t udat_countSymbols(const UDateFormat *fmt, UDateFormatSymbolType type)
Count the number of particular symbols for an UDateFormat.
FieldPosition and UFieldPosition selector for 'k' field alignment, corresponding to the UCAL_HOUR_OF_...
The long era names, for example Anno Domini.
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols ...
The quarters, for example 1st Quarter.
UDisplayContext
Display context settings.
double UDate
Date and Time data type.
The CLDR-style stand-alone "wide" weekday names.
U_CAPI 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.
FieldPosition selector for 'X' field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
UDateFormatHourCycle
Hour Cycle.
struct UFieldPositionIterator UFieldPositionIterator
C typedef for struct UFieldPositionIterator.
The short month names, for example Feb.
U_CAPI const UCalendar * udat_getCalendar(const UDateFormat *fmt)
Get the UCalendar associated with an UDateFormat.
U_CAPI int32_t udat_countAvailable(void)
Determine how many locales have date/time formatting patterns available.
Use the pattern given in the parameter to udat_open.
U_CAPI UDateFormatOpener udat_unregisterOpener(UDateFormatOpener opener, UErrorCode *status)
Un-Register a provider factory.
One more than the highest normal UDateFormatBooleanAttribute value.
#define U_HIDE_INTERNAL_API
Define this to 1 to request that internal API be "hidden".
U_CAPI void udat_registerOpener(UDateFormatOpener opener, UErrorCode *status)
Register a provider factory.
C API: Display context types (enum values)
FieldPosition and UFieldPosition selector for 'g' field alignment, corresponding to the UCAL_JULIAN_D...
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...
FieldPosition selector for 'c' field alignment, corresponding to the UCAL_DOW_LOCAL field...
FieldPosition and UFieldPosition selector for 'd' field alignment, corresponding to the UCAL_DATE fie...
indicates tolerance of pattern mismatch between input data and specified format pattern.
FieldPosition and UFieldPosition selector for time separator, no corresponding UCAL_ field...
FieldPosition and UFieldPosition selector for 'Y' field alignment, corresponding to the UCAL_YEAR_WOY...
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.
U_CAPI void udat_setNumberFormat(UDateFormat *fmt, const UNumberFormat *numberFormatToSet)
Set the UNumberFormat associated with an UDateFormat.
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.
U_CAPI UCalendarDateFields udat_toCalendarDateField(UDateFormatField field)
Maps from a UDateFormatField to the corresponding UCalendarDateFields.
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
U_CAPI void udat_adoptNumberFormat(UDateFormat *fmt, UNumberFormat *numberFormatToAdopt)
Adopt the UNumberFormat associated with an UDateFormat.
U_CAPI const char * udat_getAvailable(int32_t localeIndex)
Get a locale for which date/time formatting patterns are available.
U_CAPI 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.
void * UDateFormat
A date formatter.
U_CAPI 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 'v' field alignment, corresponding to the UCAL_ZONE_OFF...
U_CAPI UBool udat_isLenient(const UDateFormat *fmt)
Determine if an UDateFormat will perform lenient parsing.
The era names, for example AD.
Cyclic year names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols not ...
U_CAPI 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.
FieldPosition and UFieldPosition selector for 'W' field alignment, corresponding to the UCAL_WEEK_OF_...
The CLDR-style format "wide" weekday names, for example Monday.
struct UDateFormatSymbols UDateFormatSymbols
Date format symbols.
UDateFormatStyle
The possible date/time format styles.
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols ...
FieldPosition and UFieldPosition selector for 'E' field alignment, corresponding to the UCAL_DAY_OF_W...
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...
U_CAPI void udat_setSymbols(UDateFormat *format, UDateFormatSymbolType type, int32_t symbolIndex, UChar *value, int32_t valueLength, UErrorCode *status)
Set the symbols associated with an UDateFormat.
char16_t UChar
The base type for UTF-16 code units and pointers.
U_CAPI void udat_setLenient(UDateFormat *fmt, UBool isLenient)
Specify whether an UDateFormat will perform lenient parsing.
U_CAPI UDate udat_get2DigitYearStart(const UDateFormat *fmt, UErrorCode *status)
Get the year relative to which all 2-digit years are interpreted.
UDisplayContextType
Display context types, for getting values of a particular setting.
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...
U_CAPI 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.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested...
U_CAPI void udat_adoptNumberFormatForFields(UDateFormat *fmt, const UChar *fields, UNumberFormat *numberFormatToSet, UErrorCode *status)
Set the UNumberFormat for specific field associated with an UDateFormat.
FieldPosition and UFieldPosition selector for 'm' field alignment, corresponding to the UCAL_MINUTE f...
U_CAPI int32_t udat_format(const UDateFormat *format, UDate dateToFormat, UChar *result, int32_t resultLength, UFieldPosition *position, UErrorCode *status)
Format a date using a UDateFormat.
U_CAPI UDateFormat * udat_clone(const UDateFormat *fmt, UErrorCode *status)
Open a copy of a 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)
U_CAPI 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 selector for 'x' field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
U_CAPI int32_t udat_formatCalendar(const UDateFormat *format, UCalendar *calendar, UChar *result, int32_t capacity, UFieldPosition *position, UErrorCode *status)
Format a date using an UDateFormat.
C API: UFieldPositionIterator for use with format APIs.
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.
U_CAPI void udat_close(UDateFormat *format)
Close a UDateFormat.
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.
U_CAPI const UNumberFormat * udat_getNumberFormat(const UDateFormat *fmt)
Get the UNumberFormat associated with an UDateFormat.
Number of FieldPosition and UFieldPosition selectors for DateFormat and UDateFormat.
FieldPosition and UFieldPosition selector for 'Z' field alignment, corresponding to the UCAL_ZONE_OFF...
FieldPosition and UFieldPosition selector for 'H' field alignment, corresponding to the UCAL_HOUR_OF_...
U_CAPI UBool udat_getBooleanAttribute(const UDateFormat *fmt, UDateFormatBooleanAttribute attr, UErrorCode *status)
Get a boolean attribute associated with a UDateFormat.
UDateFormatBooleanAttribute
DateFormat boolean attributes.
U_CAPI const UNumberFormat * udat_getNumberFormatForField(const UDateFormat *fmt, UChar field)
Get the UNumberFormat for specific field associated with an UDateFormat.
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) ...
UDateFormat *(* UDateFormatOpener)(UDateFormatStyle timeStyle, UDateFormatStyle dateStyle, const char *locale, const UChar *tzID, int32_t tzIDLength, const UChar *pattern, int32_t patternLength, UErrorCode *status)
FieldPosition selector for "U" field alignment, corresponding to cyclic year names.
U_CAPI void udat_setBooleanAttribute(UDateFormat *fmt, UDateFormatBooleanAttribute attr, UBool newValue, UErrorCode *status)
Set a boolean attribute associated with a UDateFormat.
U_CAPI void udat_set2DigitYearStart(UDateFormat *fmt, UDate d, UErrorCode *status)
Set the year relative to which all 2-digit years will be interpreted.
int8_t UBool
The ICU boolean type, a signed-byte integer.
C API: Compatibility APIs for number formatting.
U_CAPI void udat_setCalendar(UDateFormat *fmt, const UCalendar *calendarToSet)
Set the UCalendar associated with an UDateFormat.
Standalone version of UDAT_SHORTER_WEEKDAYS.