ICU 67.1  67.1
udat.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4  *******************************************************************************
5  * Copyright (C) 1996-2016, International Business Machines
6  * Corporation and others. All Rights Reserved.
7  *******************************************************************************
8 */
9 
10 #ifndef UDAT_H
11 #define UDAT_H
12 
13 #include "unicode/utypes.h"
14 
15 #if !UCONFIG_NO_FORMATTING
16 
17 #include "unicode/localpointer.h"
18 #include "unicode/ucal.h"
19 #include "unicode/unum.h"
21 #include "unicode/ufieldpositer.h"
153 typedef void* UDateFormat;
154 
158 typedef enum UDateFormatStyle {
169 
171  UDAT_RELATIVE = (1 << 7),
172 
173  UDAT_FULL_RELATIVE = UDAT_FULL | UDAT_RELATIVE,
174 
175  UDAT_LONG_RELATIVE = UDAT_LONG | UDAT_RELATIVE,
176 
177  UDAT_MEDIUM_RELATIVE = UDAT_MEDIUM | UDAT_RELATIVE,
178 
179  UDAT_SHORT_RELATIVE = UDAT_SHORT | UDAT_RELATIVE,
180 
181 
183  UDAT_NONE = -1,
184 
191 
192 #ifndef U_HIDE_INTERNAL_API
195 #endif /* U_HIDE_INTERNAL_API */
197 
198 /* Skeletons for dates. */
199 
204 #define UDAT_YEAR "y"
209 #define UDAT_QUARTER "QQQQ"
214 #define UDAT_ABBR_QUARTER "QQQ"
219 #define UDAT_YEAR_QUARTER "yQQQQ"
224 #define UDAT_YEAR_ABBR_QUARTER "yQQQ"
229 #define UDAT_MONTH "MMMM"
234 #define UDAT_ABBR_MONTH "MMM"
239 #define UDAT_NUM_MONTH "M"
244 #define UDAT_YEAR_MONTH "yMMMM"
249 #define UDAT_YEAR_ABBR_MONTH "yMMM"
254 #define UDAT_YEAR_NUM_MONTH "yM"
259 #define UDAT_DAY "d"
265 #define UDAT_YEAR_MONTH_DAY "yMMMMd"
271 #define UDAT_YEAR_ABBR_MONTH_DAY "yMMMd"
277 #define UDAT_YEAR_NUM_MONTH_DAY "yMd"
282 #define UDAT_WEEKDAY "EEEE"
287 #define UDAT_ABBR_WEEKDAY "E"
293 #define UDAT_YEAR_MONTH_WEEKDAY_DAY "yMMMMEEEEd"
299 #define UDAT_YEAR_ABBR_MONTH_WEEKDAY_DAY "yMMMEd"
305 #define UDAT_YEAR_NUM_MONTH_WEEKDAY_DAY "yMEd"
311 #define UDAT_MONTH_DAY "MMMMd"
317 #define UDAT_ABBR_MONTH_DAY "MMMd"
323 #define UDAT_NUM_MONTH_DAY "Md"
329 #define UDAT_MONTH_WEEKDAY_DAY "MMMMEEEEd"
335 #define UDAT_ABBR_MONTH_WEEKDAY_DAY "MMMEd"
341 #define UDAT_NUM_MONTH_WEEKDAY_DAY "MEd"
342 
343 /* Skeletons for times. */
344 
349 #define UDAT_HOUR "j"
354 #define UDAT_HOUR24 "H"
359 #define UDAT_MINUTE "m"
365 #define UDAT_HOUR_MINUTE "jm"
371 #define UDAT_HOUR24_MINUTE "Hm"
376 #define UDAT_SECOND "s"
383 #define UDAT_HOUR_MINUTE_SECOND "jms"
390 #define UDAT_HOUR24_MINUTE_SECOND "Hms"
396 #define UDAT_MINUTE_SECOND "ms"
397 
398 /* Skeletons for time zones. */
399 
407 #define UDAT_LOCATION_TZ "VVVV"
415 #define UDAT_GENERIC_TZ "vvvv"
423 #define UDAT_ABBR_GENERIC_TZ "v"
431 #define UDAT_SPECIFIC_TZ "zzzz"
439 #define UDAT_ABBR_SPECIFIC_TZ "z"
447 #define UDAT_ABBR_UTC_TZ "ZZZZ"
448 
449 /* deprecated skeleton constants */
450 
451 #ifndef U_HIDE_DEPRECATED_API
456 #define UDAT_STANDALONE_MONTH "LLLL"
461 #define UDAT_ABBR_STANDALONE_MONTH "LLL"
462 
467 #define UDAT_HOUR_MINUTE_GENERIC_TZ "jmv"
472 #define UDAT_HOUR_MINUTE_TZ "jmz"
477 #define UDAT_HOUR_GENERIC_TZ "jv"
482 #define UDAT_HOUR_TZ "jz"
483 #endif /* U_HIDE_DEPRECATED_API */
484 
485 #ifndef U_HIDE_INTERNAL_API
491 #define JP_ERA_2019_ROOT "Reiwa"
497 #define JP_ERA_2019_JA "\\u4EE4\\u548C"
503 #define JP_ERA_2019_NARROW "R"
504 #endif // U_HIDE_INTERNAL_API
505 
511 typedef enum UDateFormatField {
518 
525 
532 
539 
548 
557 
564 
571 
586 
593 
600 
607 
614 
621 
628 
637 
646 
654 
661 
668 
675 
682 
689 
697 
711 
719 
728 
737 
744 
753 
761 
769 
777 
778 #ifndef U_HIDE_INTERNAL_API
785 #endif /* U_HIDE_INTERNAL_API */
786 
794 
795  /* FieldPosition selector for 'B' field alignment.
796  * Displays flexible day periods, such as "in the morning", if available.
797  * @stable ICU 57
798  */
799  UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36,
800 
801 #ifndef U_HIDE_INTERNAL_API
809 #endif /* U_HIDE_INTERNAL_API */
810 
811 #ifndef U_HIDE_DEPRECATED_API
818  UDAT_FIELD_COUNT = 38
819 #endif /* U_HIDE_DEPRECATED_API */
821 
822 
823 #ifndef U_HIDE_INTERNAL_API
829 #define UDAT_HAS_PATTERN_CHAR_FOR_TIME_SEPARATOR 0
830 #endif /* U_HIDE_INTERNAL_API */
831 
832 
841 U_CAPI UCalendarDateFields U_EXPORT2
843 
844 
873 U_CAPI UDateFormat* U_EXPORT2
875  UDateFormatStyle dateStyle,
876  const char *locale,
877  const UChar *tzID,
878  int32_t tzIDLength,
879  const UChar *pattern,
880  int32_t patternLength,
881  UErrorCode *status);
882 
883 
890 U_CAPI void U_EXPORT2
892 
893 
923 
924  /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
925  * it is needed for layout of DateFormat object. */
926 #ifndef U_FORCE_HIDE_DEPRECATED_API
932 #endif // U_FORCE_HIDE_DEPRECATED_API
934 
945 U_CAPI UBool U_EXPORT2
947 
958 U_CAPI void U_EXPORT2
960 
961 #ifndef U_HIDE_DRAFT_API
966 typedef enum UDateFormatHourCycle {
972 
978 
984 
991 #endif /* U_HIDE_DRAFT_API */
992 
993 #if U_SHOW_CPLUSPLUS_API
994 
995 U_NAMESPACE_BEGIN
996 
1007 
1008 U_NAMESPACE_END
1009 
1010 #endif
1011 
1020 U_CAPI UDateFormat* U_EXPORT2
1022  UErrorCode *status);
1023 
1042 U_CAPI int32_t U_EXPORT2
1043 udat_format( const UDateFormat* format,
1044  UDate dateToFormat,
1045  UChar* result,
1046  int32_t resultLength,
1047  UFieldPosition* position,
1048  UErrorCode* status);
1049 
1072 U_CAPI int32_t U_EXPORT2
1074  UCalendar* calendar,
1075  UChar* result,
1076  int32_t capacity,
1077  UFieldPosition* position,
1078  UErrorCode* status);
1079 
1107 U_CAPI int32_t U_EXPORT2
1109  UDate dateToFormat,
1110  UChar* result,
1111  int32_t resultLength,
1112  UFieldPositionIterator* fpositer,
1113  UErrorCode* status);
1114 
1145 U_CAPI int32_t U_EXPORT2
1147  UCalendar* calendar,
1148  UChar* result,
1149  int32_t capacity,
1150  UFieldPositionIterator* fpositer,
1151  UErrorCode* status);
1152 
1153 
1179 U_CAPI UDate U_EXPORT2
1180 udat_parse(const UDateFormat* format,
1181  const UChar* text,
1182  int32_t textLength,
1183  int32_t *parsePos,
1184  UErrorCode *status);
1185 
1207 U_CAPI void U_EXPORT2
1209  UCalendar* calendar,
1210  const UChar* text,
1211  int32_t textLength,
1212  int32_t *parsePos,
1213  UErrorCode *status);
1214 
1224 U_CAPI UBool U_EXPORT2
1226 
1236 U_CAPI void U_EXPORT2
1238  UBool isLenient);
1239 
1249 U_CAPI const UCalendar* U_EXPORT2
1251 
1261 U_CAPI void U_EXPORT2
1263  const UCalendar* calendarToSet);
1264 
1274 U_CAPI const UNumberFormat* U_EXPORT2
1276 
1286 U_CAPI const UNumberFormat* U_EXPORT2
1288 
1304 U_CAPI void U_EXPORT2
1306  const UChar* fields,
1307  UNumberFormat* numberFormatToSet,
1308  UErrorCode* status);
1321 U_CAPI void U_EXPORT2
1323  const UNumberFormat* numberFormatToSet);
1333 U_CAPI void U_EXPORT2
1335  UNumberFormat* numberFormatToAdopt);
1345 U_CAPI const char* U_EXPORT2
1346 udat_getAvailable(int32_t localeIndex);
1347 
1356 U_CAPI int32_t U_EXPORT2
1358 
1369 U_CAPI UDate U_EXPORT2
1371  UErrorCode *status);
1372 
1383 U_CAPI void U_EXPORT2
1385  UDate d,
1386  UErrorCode *status);
1387 
1400 U_CAPI int32_t U_EXPORT2
1402  UBool localized,
1403  UChar *result,
1404  int32_t resultLength,
1405  UErrorCode *status);
1406 
1417 U_CAPI void U_EXPORT2
1419  UBool localized,
1420  const UChar *pattern,
1421  int32_t patternLength);
1422 
1453  UDAT_STANDALONE_SHORT_MONTHS,
1454  UDAT_STANDALONE_NARROW_MONTHS,
1470  UDAT_STANDALONE_SHORT_QUARTERS,
1519 
1520 struct UDateFormatSymbols;
1525 typedef struct UDateFormatSymbols UDateFormatSymbols;
1526 
1543 U_CAPI int32_t U_EXPORT2
1545  UDateFormatSymbolType type,
1546  int32_t symbolIndex,
1547  UChar *result,
1548  int32_t resultLength,
1549  UErrorCode *status);
1550 
1563 U_CAPI int32_t U_EXPORT2
1565  UDateFormatSymbolType type);
1566 
1582 U_CAPI void U_EXPORT2
1584  UDateFormatSymbolType type,
1585  int32_t symbolIndex,
1586  UChar *value,
1587  int32_t valueLength,
1588  UErrorCode *status);
1589 
1599 U_CAPI const char* U_EXPORT2
1601  ULocDataLocaleType type,
1602  UErrorCode* status);
1603 
1612 U_CAPI void U_EXPORT2
1614 
1624 U_CAPI UDisplayContext U_EXPORT2
1626 
1627 #ifndef U_HIDE_INTERNAL_API
1639 U_INTERNAL int32_t U_EXPORT2
1641  UChar *result,
1642  int32_t resultLength,
1643  UErrorCode *status);
1644 
1656 U_INTERNAL int32_t U_EXPORT2
1658  UChar *result,
1659  int32_t resultLength,
1660  UErrorCode *status);
1661 
1674 U_INTERNAL void U_EXPORT2
1676  const UChar *datePattern,
1677  int32_t datePatternLength,
1678  const UChar *timePattern,
1679  int32_t timePatternLength,
1680  UErrorCode *status);
1681 
1686 typedef UDateFormat* (U_EXPORT2 *UDateFormatOpener) (UDateFormatStyle timeStyle,
1687  UDateFormatStyle dateStyle,
1688  const char *locale,
1689  const UChar *tzID,
1690  int32_t tzIDLength,
1691  const UChar *pattern,
1692  int32_t patternLength,
1693  UErrorCode *status);
1694 
1699 U_INTERNAL void U_EXPORT2
1701 
1706 U_INTERNAL UDateFormatOpener U_EXPORT2
1708 #endif /* U_HIDE_INTERNAL_API */
1709 
1710 
1711 #endif /* #if !UCONFIG_NO_FORMATTING */
1712 
1713 #endif
"Smart pointer" class, closes a UDateFormat via udat_close().
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:550
A struct representing a range of text containing a specific field.
Definition: umisc.h:34
C API: Calendar.
UCalendarDateFields
Possible fields in a UCalendar.
Definition: ucal.h:199
void * UCalendar
A calendar.
Definition: ucal.h:169
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.
UDateFormat *(* UDateFormatOpener)(UDateFormatStyle timeStyle, UDateFormatStyle dateStyle, const char *locale, const UChar *tzID, int32_t tzIDLength, const UChar *pattern, int32_t patternLength, UErrorCode *status)
Definition: udat.h:1686
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.
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.
U_CAPI const UCalendar * udat_getCalendar(const UDateFormat *fmt)
Get the UCalendar associated with an UDateFormat.
void * UDateFormat
A date formatter.
Definition: udat.h:153
U_CAPI UBool udat_isLenient(const UDateFormat *fmt)
Determine if an UDateFormat will perform lenient parsing.
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.
U_CAPI UCalendarDateFields udat_toCalendarDateField(UDateFormatField field)
Maps from a UDateFormatField to the corresponding UCalendarDateFields.
U_CAPI const UNumberFormat * udat_getNumberFormatForField(const UDateFormat *fmt, UChar field)
Get the UNumberFormat for specific field associated with an UDateFormat.
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.
U_CAPI void udat_adoptNumberFormatForFields(UDateFormat *fmt, const UChar *fields, UNumberFormat *numberFormatToSet, UErrorCode *status)
Set the UNumberFormat for specific field associated with an UDateFormat.
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...
U_CAPI void udat_close(UDateFormat *format)
Close a UDateFormat.
UDateFormatSymbolType
The possible types of date format symbols.
Definition: udat.h:1427
@ UDAT_ERAS
The era names, for example AD.
Definition: udat.h:1429
@ UDAT_CYCLIC_YEARS_WIDE
Cyclic year names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols not ...
Definition: udat.h:1489
@ UDAT_CYCLIC_YEARS_NARROW
Cyclic year names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols not ...
Definition: udat.h:1500
@ UDAT_STANDALONE_NARROW_WEEKDAYS
The CLDR-style stand-alone "narrow" weekday names.
Definition: udat.h:1463
@ UDAT_SHORT_QUARTERS
The short quarter names, for example Q1.
Definition: udat.h:1467
@ UDAT_STANDALONE_QUARTERS
Standalone context versions of quarters.
Definition: udat.h:1469
@ UDAT_SHORT_WEEKDAYS
The CLDR-style format "abbreviated" (not "short") weekday names, for example "Mon....
Definition: udat.h:1440
@ UDAT_ZODIAC_NAMES_NARROW
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols ...
Definition: udat.h:1517
@ UDAT_NARROW_WEEKDAYS
The CLDR-style format "narrow" weekday names, for example "M".
Definition: udat.h:1450
@ UDAT_STANDALONE_WEEKDAYS
The CLDR-style stand-alone "wide" weekday names.
Definition: udat.h:1456
@ UDAT_ERA_NAMES
The long era names, for example Anno Domini.
Definition: udat.h:1446
@ UDAT_STANDALONE_SHORTER_WEEKDAYS
Standalone version of UDAT_SHORTER_WEEKDAYS.
Definition: udat.h:1483
@ UDAT_WEEKDAYS
The CLDR-style format "wide" weekday names, for example Monday.
Definition: udat.h:1435
@ UDAT_QUARTERS
The quarters, for example 1st Quarter.
Definition: udat.h:1465
@ UDAT_LOCALIZED_CHARS
The localized characters.
Definition: udat.h:1444
@ UDAT_SHORTER_WEEKDAYS
The CLDR-style short weekday names, e.g.
Definition: udat.h:1478
@ UDAT_ZODIAC_NAMES_ABBREVIATED
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage)
Definition: udat.h:1511
@ UDAT_ZODIAC_NAMES_WIDE
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols ...
Definition: udat.h:1506
@ UDAT_MONTHS
The month names, for example February.
Definition: udat.h:1431
@ UDAT_NARROW_MONTHS
The narrow month names, for example F.
Definition: udat.h:1448
@ UDAT_CYCLIC_YEARS_ABBREVIATED
Cyclic year names (only supported for some calendars, and only for FORMAT usage)
Definition: udat.h:1494
@ UDAT_STANDALONE_MONTHS
Standalone context versions of months.
Definition: udat.h:1452
@ UDAT_STANDALONE_SHORT_WEEKDAYS
The CLDR-style stand-alone "abbreviated" (not "short") weekday names.
Definition: udat.h:1461
@ UDAT_SHORT_MONTHS
The short month names, for example Feb.
Definition: udat.h:1433
@ UDAT_AM_PMS
The AM/PM names, for example AM.
Definition: udat.h:1442
U_CAPI void udat_setNumberFormat(UDateFormat *fmt, const UNumberFormat *numberFormatToSet)
Set the UNumberFormat associated with an 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.
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 void udat_setLenient(UDateFormat *fmt, UBool isLenient)
Specify whether an UDateFormat will perform lenient parsing.
U_CAPI int32_t udat_countAvailable(void)
Determine how many locales have date/time formatting patterns available.
UDateFormatOpener udat_unregisterOpener(UDateFormatOpener opener, UErrorCode *status)
Un-Register a provider factory.
struct UDateFormatSymbols UDateFormatSymbols
Date format symbols.
Definition: udat.h:1525
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...
U_CAPI const UNumberFormat * udat_getNumberFormat(const UDateFormat *fmt)
Get the UNumberFormat associated with an UDateFormat.
U_CAPI int32_t udat_toPattern(const UDateFormat *fmt, UBool localized, UChar *result, int32_t resultLength, UErrorCode *status)
Extract the pattern from a UDateFormat.
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_format(const UDateFormat *format, UDate dateToFormat, UChar *result, int32_t resultLength, UFieldPosition *position, UErrorCode *status)
Format a date using a UDateFormat.
U_CAPI void udat_setBooleanAttribute(UDateFormat *fmt, UDateFormatBooleanAttribute attr, UBool newValue, UErrorCode *status)
Set a boolean attribute associated with a UDateFormat.
U_CAPI UDate udat_get2DigitYearStart(const UDateFormat *fmt, UErrorCode *status)
Get the year relative to which all 2-digit years are interpreted.
U_CAPI void udat_adoptNumberFormat(UDateFormat *fmt, UNumberFormat *numberFormatToAdopt)
Adopt the UNumberFormat associated with an UDateFormat.
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.
U_CAPI int32_t udat_countSymbols(const UDateFormat *fmt, UDateFormatSymbolType type)
Count the number of particular symbols for an UDateFormat.
U_CAPI const char * udat_getAvailable(int32_t localeIndex)
Get a locale for which date/time formatting patterns are available.
void udat_registerOpener(UDateFormatOpener opener, UErrorCode *status)
Register a provider factory.
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.
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.
U_CAPI void udat_setCalendar(UDateFormat *fmt, const UCalendar *calendarToSet)
Set the UCalendar associated with an UDateFormat.
UDateFormatField
FieldPosition and UFieldPosition selectors for format fields defined by DateFormat and UDateFormat.
Definition: udat.h:511
@ UDAT_AM_PM_FIELD
FieldPosition and UFieldPosition selector for 'a' field alignment, corresponding to the UCAL_AM_PM fi...
Definition: udat.h:627
@ UDAT_TIMEZONE_FIELD
FieldPosition and UFieldPosition selector for 'z' field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:653
@ UDAT_DOW_LOCAL_FIELD
FieldPosition and UFieldPosition selector for 'e' field alignment, corresponding to the UCAL_DOW_LOCA...
Definition: udat.h:667
@ UDAT_DATE_FIELD
FieldPosition and UFieldPosition selector for 'd' field alignment, corresponding to the UCAL_DATE fie...
Definition: udat.h:538
@ UDAT_MONTH_FIELD
FieldPosition and UFieldPosition selector for 'M' field alignment, corresponding to the UCAL_MONTH fi...
Definition: udat.h:531
@ UDAT_JULIAN_DAY_FIELD
FieldPosition and UFieldPosition selector for 'g' field alignment, corresponding to the UCAL_JULIAN_D...
Definition: udat.h:681
@ UDAT_FIELD_COUNT
Number of FieldPosition and UFieldPosition selectors for DateFormat and UDateFormat.
Definition: udat.h:818
@ UDAT_EXTENDED_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'u' field alignment, corresponding to the UCAL_EXTENDED...
Definition: udat.h:674
@ UDAT_RELATED_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'r' field alignment, no directly corresponding UCAL_ fi...
Definition: udat.h:784
@ UDAT_DAY_OF_WEEK_FIELD
FieldPosition and UFieldPosition selector for 'E' field alignment, corresponding to the UCAL_DAY_OF_W...
Definition: udat.h:592
@ UDAT_MILLISECONDS_IN_DAY_FIELD
FieldPosition and UFieldPosition selector for 'A' field alignment, corresponding to the UCAL_MILLISEC...
Definition: udat.h:688
@ UDAT_TIMEZONE_SPECIAL_FIELD
FieldPosition and UFieldPosition selector for 'V' field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:743
@ UDAT_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'y' field alignment, corresponding to the UCAL_YEAR fie...
Definition: udat.h:524
@ UDAT_ERA_FIELD
FieldPosition and UFieldPosition selector for 'G' field alignment, corresponding to the UCAL_ERA fiel...
Definition: udat.h:517
@ UDAT_STANDALONE_QUARTER_FIELD
FieldPosition selector for the "q" field alignment, corresponding to stand-alone quarters.
Definition: udat.h:736
@ UDAT_QUARTER_FIELD
FieldPosition selector for "Q" field alignment, corresponding to quarters.
Definition: udat.h:727
@ UDAT_TIMEZONE_RFC_FIELD
FieldPosition and UFieldPosition selector for 'Z' field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:696
@ UDAT_DAY_OF_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'D' field alignment, corresponding to the UCAL_DAY_OF_Y...
Definition: udat.h:599
@ UDAT_WEEK_OF_MONTH_FIELD
FieldPosition and UFieldPosition selector for 'W' field alignment, corresponding to the UCAL_WEEK_OF_...
Definition: udat.h:620
@ UDAT_FRACTIONAL_SECOND_FIELD
FieldPosition and UFieldPosition selector for 'S' field alignment, corresponding to the UCAL_MILLISEC...
Definition: udat.h:585
@ UDAT_STANDALONE_DAY_FIELD
FieldPosition selector for 'c' field alignment, corresponding to the UCAL_DOW_LOCAL field.
Definition: udat.h:710
@ UDAT_TIME_SEPARATOR_FIELD
FieldPosition and UFieldPosition selector for time separator, no corresponding UCAL_ field.
Definition: udat.h:808
@ UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD
FieldPosition selector for 'O' field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
Definition: udat.h:760
@ UDAT_DAY_OF_WEEK_IN_MONTH_FIELD
FieldPosition and UFieldPosition selector for 'F' field alignment, corresponding to the UCAL_DAY_OF_W...
Definition: udat.h:606
@ UDAT_TIMEZONE_ISO_LOCAL_FIELD
FieldPosition selector for 'x' field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
Definition: udat.h:776
@ UDAT_SECOND_FIELD
FieldPosition and UFieldPosition selector for 's' field alignment, corresponding to the UCAL_SECOND f...
Definition: udat.h:570
@ UDAT_HOUR1_FIELD
FieldPosition and UFieldPosition selector for 'h' field alignment, corresponding to the UCAL_HOUR fie...
Definition: udat.h:636
@ UDAT_YEAR_NAME_FIELD
FieldPosition selector for "U" field alignment, corresponding to cyclic year names.
Definition: udat.h:752
@ UDAT_AM_PM_MIDNIGHT_NOON_FIELD
FieldPosition selector for 'b' field alignment.
Definition: udat.h:793
@ UDAT_MINUTE_FIELD
FieldPosition and UFieldPosition selector for 'm' field alignment, corresponding to the UCAL_MINUTE f...
Definition: udat.h:563
@ UDAT_TIMEZONE_GENERIC_FIELD
FieldPosition and UFieldPosition selector for 'v' field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:703
@ UDAT_HOUR0_FIELD
FieldPosition and UFieldPosition selector for 'K' field alignment, corresponding to the UCAL_HOUR fie...
Definition: udat.h:645
@ UDAT_YEAR_WOY_FIELD
FieldPosition and UFieldPosition selector for 'Y' field alignment, corresponding to the UCAL_YEAR_WOY...
Definition: udat.h:660
@ UDAT_WEEK_OF_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'w' field alignment, corresponding to the UCAL_WEEK_OF_...
Definition: udat.h:613
@ UDAT_TIMEZONE_ISO_FIELD
FieldPosition selector for 'X' field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
Definition: udat.h:768
@ UDAT_HOUR_OF_DAY0_FIELD
FieldPosition and UFieldPosition selector for 'H' field alignment, corresponding to the UCAL_HOUR_OF_...
Definition: udat.h:556
@ UDAT_STANDALONE_MONTH_FIELD
FieldPosition selector for 'L' field alignment, corresponding to the UCAL_MONTH field.
Definition: udat.h:718
@ UDAT_HOUR_OF_DAY1_FIELD
FieldPosition and UFieldPosition selector for 'k' field alignment, corresponding to the UCAL_HOUR_OF_...
Definition: udat.h:547
UDateFormatStyle
The possible date/time format styles.
Definition: udat.h:158
@ UDAT_PATTERN
Use the pattern given in the parameter to udat_open.
Definition: udat.h:190
@ UDAT_RELATIVE
Bitfield for relative date.
Definition: udat.h:171
@ UDAT_DEFAULT
Default style.
Definition: udat.h:168
@ UDAT_IGNORE
Definition: udat.h:194
@ UDAT_SHORT
Short style.
Definition: udat.h:166
@ UDAT_FULL
Full style.
Definition: udat.h:160
@ UDAT_LONG
Long style.
Definition: udat.h:162
@ UDAT_MEDIUM
Medium style.
Definition: udat.h:164
@ UDAT_NONE
No style.
Definition: udat.h:183
UDateFormatHourCycle
Hour Cycle.
Definition: udat.h:966
@ UDAT_HOUR_CYCLE_11
Hour in am/pm (0~11)
Definition: udat.h:971
@ UDAT_HOUR_CYCLE_23
Hour in day (0~23)
Definition: udat.h:983
@ UDAT_HOUR_CYCLE_24
Hour in day (1~24)
Definition: udat.h:989
@ UDAT_HOUR_CYCLE_12
Hour in am/pm (1~12)
Definition: udat.h:977
U_CAPI UDateFormat * udat_clone(const UDateFormat *fmt, UErrorCode *status)
Open a copy of a UDateFormat.
U_CAPI UBool udat_getBooleanAttribute(const UDateFormat *fmt, UDateFormatBooleanAttribute attr, UErrorCode *status)
Get a boolean attribute associated with a UDateFormat.
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.
U_CAPI void udat_applyPattern(UDateFormat *format, UBool localized, const UChar *pattern, int32_t patternLength)
Set the pattern used by an UDateFormat.
UDateFormatBooleanAttribute
DateFormat boolean attributes.
Definition: udat.h:899
@ UDAT_PARSE_ALLOW_WHITESPACE
indicates whether whitespace is allowed.
Definition: udat.h:904
@ UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH
indicates tolerance of pattern mismatch between input data and specified format pattern.
Definition: udat.h:922
@ UDAT_BOOLEAN_ATTRIBUTE_COUNT
One more than the highest normal UDateFormatBooleanAttribute value.
Definition: udat.h:931
@ UDAT_PARSE_PARTIAL_LITERAL_MATCH
indicates tolerance of a partial literal match e.g.
Definition: udat.h:916
@ UDAT_PARSE_ALLOW_NUMERIC
indicates tolerance of numeric data when String data may be assumed.
Definition: udat.h:910
C API: Display context types (enum values)
UDisplayContextType
Display context types, for getting values of a particular setting.
UDisplayContext
Display context settings.
C API: UFieldPositionIterator for use with format APIs.
struct UFieldPositionIterator UFieldPositionIterator
C typedef for struct UFieldPositionIterator.
Definition: ufieldpositer.h:44
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested,...
Definition: uloc.h:338
#define U_INTERNAL
This is used to declare a function as an internal ICU C API
Definition: umachine.h:119
int8_t UBool
The ICU boolean type.
Definition: umachine.h:261
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition: umachine.h:109
char16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:376
C API: Compatibility APIs for number formatting.
void * UNumberFormat
A number formatter.
Definition: unum.h:141
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
#define U_HIDE_INTERNAL_API
Define this to 1 to request that internal API be "hidden".
Definition: utypes.h:87
double UDate
Date and Time data type.
Definition: utypes.h:203