ICU 68.2  68.2
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/ucal.h"
18 #include "unicode/unum.h"
20 #include "unicode/ufieldpositer.h"
21 
22 #if U_SHOW_CPLUSPLUS_API
23 #include "unicode/localpointer.h"
24 #endif // U_SHOW_CPLUSPLUS_API
25 
157 typedef void* UDateFormat;
158 
162 typedef enum UDateFormatStyle {
173 
175  UDAT_RELATIVE = (1 << 7),
176 
177  UDAT_FULL_RELATIVE = UDAT_FULL | UDAT_RELATIVE,
178 
179  UDAT_LONG_RELATIVE = UDAT_LONG | UDAT_RELATIVE,
180 
181  UDAT_MEDIUM_RELATIVE = UDAT_MEDIUM | UDAT_RELATIVE,
182 
183  UDAT_SHORT_RELATIVE = UDAT_SHORT | UDAT_RELATIVE,
184 
185 
187  UDAT_NONE = -1,
188 
195 
196 #ifndef U_HIDE_INTERNAL_API
199 #endif /* U_HIDE_INTERNAL_API */
201 
202 /* Skeletons for dates. */
203 
208 #define UDAT_YEAR "y"
209 
213 #define UDAT_QUARTER "QQQQ"
214 
218 #define UDAT_ABBR_QUARTER "QQQ"
219 
223 #define UDAT_YEAR_QUARTER "yQQQQ"
224 
228 #define UDAT_YEAR_ABBR_QUARTER "yQQQ"
229 
233 #define UDAT_MONTH "MMMM"
234 
238 #define UDAT_ABBR_MONTH "MMM"
239 
243 #define UDAT_NUM_MONTH "M"
244 
248 #define UDAT_YEAR_MONTH "yMMMM"
249 
253 #define UDAT_YEAR_ABBR_MONTH "yMMM"
254 
258 #define UDAT_YEAR_NUM_MONTH "yM"
259 
263 #define UDAT_DAY "d"
264 
269 #define UDAT_YEAR_MONTH_DAY "yMMMMd"
270 
275 #define UDAT_YEAR_ABBR_MONTH_DAY "yMMMd"
276 
281 #define UDAT_YEAR_NUM_MONTH_DAY "yMd"
282 
286 #define UDAT_WEEKDAY "EEEE"
287 
291 #define UDAT_ABBR_WEEKDAY "E"
292 
297 #define UDAT_YEAR_MONTH_WEEKDAY_DAY "yMMMMEEEEd"
298 
303 #define UDAT_YEAR_ABBR_MONTH_WEEKDAY_DAY "yMMMEd"
304 
309 #define UDAT_YEAR_NUM_MONTH_WEEKDAY_DAY "yMEd"
310 
315 #define UDAT_MONTH_DAY "MMMMd"
316 
321 #define UDAT_ABBR_MONTH_DAY "MMMd"
322 
327 #define UDAT_NUM_MONTH_DAY "Md"
328 
333 #define UDAT_MONTH_WEEKDAY_DAY "MMMMEEEEd"
334 
339 #define UDAT_ABBR_MONTH_WEEKDAY_DAY "MMMEd"
340 
345 #define UDAT_NUM_MONTH_WEEKDAY_DAY "MEd"
346 
347 /* Skeletons for times. */
348 
353 #define UDAT_HOUR "j"
354 
358 #define UDAT_HOUR24 "H"
359 
363 #define UDAT_MINUTE "m"
364 
369 #define UDAT_HOUR_MINUTE "jm"
370 
375 #define UDAT_HOUR24_MINUTE "Hm"
376 
380 #define UDAT_SECOND "s"
381 
387 #define UDAT_HOUR_MINUTE_SECOND "jms"
388 
394 #define UDAT_HOUR24_MINUTE_SECOND "Hms"
395 
400 #define UDAT_MINUTE_SECOND "ms"
401 
402 /* Skeletons for time zones. */
403 
411 #define UDAT_LOCATION_TZ "VVVV"
412 
419 #define UDAT_GENERIC_TZ "vvvv"
420 
427 #define UDAT_ABBR_GENERIC_TZ "v"
428 
435 #define UDAT_SPECIFIC_TZ "zzzz"
436 
443 #define UDAT_ABBR_SPECIFIC_TZ "z"
444 
451 #define UDAT_ABBR_UTC_TZ "ZZZZ"
452 
453 /* deprecated skeleton constants */
454 
455 #ifndef U_HIDE_DEPRECATED_API
456 
460 #define UDAT_STANDALONE_MONTH "LLLL"
461 
465 #define UDAT_ABBR_STANDALONE_MONTH "LLL"
466 
471 #define UDAT_HOUR_MINUTE_GENERIC_TZ "jmv"
472 
476 #define UDAT_HOUR_MINUTE_TZ "jmz"
477 
481 #define UDAT_HOUR_GENERIC_TZ "jv"
482 
486 #define UDAT_HOUR_TZ "jz"
487 #endif /* U_HIDE_DEPRECATED_API */
488 
489 #ifndef U_HIDE_INTERNAL_API
490 
495 #define JP_ERA_2019_ROOT "Reiwa"
496 
501 #define JP_ERA_2019_JA "\\u4EE4\\u548C"
502 
507 #define JP_ERA_2019_NARROW "R"
508 #endif // U_HIDE_INTERNAL_API
509 
515 typedef enum UDateFormatField {
522 
529 
536 
543 
552 
561 
568 
575 
590 
597 
604 
611 
618 
625 
632 
641 
650 
658 
665 
672 
679 
686 
693 
701 
715 
723 
732 
741 
748 
757 
765 
773 
781 
782 #ifndef U_HIDE_INTERNAL_API
783 
789 #endif /* U_HIDE_INTERNAL_API */
790 
798 
799  /* FieldPosition selector for 'B' field alignment.
800  * Displays flexible day periods, such as "in the morning", if available.
801  * @stable ICU 57
802  */
803  UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36,
804 
805 #ifndef U_HIDE_INTERNAL_API
806 
813 #endif /* U_HIDE_INTERNAL_API */
814 
815 #ifndef U_HIDE_DEPRECATED_API
816 
823 #endif /* U_HIDE_DEPRECATED_API */
825 
826 
827 #ifndef U_HIDE_INTERNAL_API
828 
833 #define UDAT_HAS_PATTERN_CHAR_FOR_TIME_SEPARATOR 0
834 #endif /* U_HIDE_INTERNAL_API */
835 
836 
859 U_CAPI UCalendarDateFields U_EXPORT2
861 
862 
891 U_CAPI UDateFormat* U_EXPORT2
892 udat_open(UDateFormatStyle timeStyle,
893  UDateFormatStyle dateStyle,
894  const char *locale,
895  const UChar *tzID,
896  int32_t tzIDLength,
897  const UChar *pattern,
898  int32_t patternLength,
899  UErrorCode *status);
900 
901 
908 U_CAPI void U_EXPORT2
909 udat_close(UDateFormat* format);
910 
911 
941 
942  /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
943  * it is needed for layout of DateFormat object. */
944 #ifndef U_FORCE_HIDE_DEPRECATED_API
945 
950 #endif // U_FORCE_HIDE_DEPRECATED_API
952 
963 U_CAPI UBool U_EXPORT2
965 
976 U_CAPI void U_EXPORT2
978 
979 #ifndef U_HIDE_DRAFT_API
980 
984 typedef enum UDateFormatHourCycle {
990 
996 
1002 
1009 #endif /* U_HIDE_DRAFT_API */
1010 
1011 #if U_SHOW_CPLUSPLUS_API
1012 
1013 U_NAMESPACE_BEGIN
1014 
1025 
1026 U_NAMESPACE_END
1027 
1028 #endif
1029 
1038 U_CAPI UDateFormat* U_EXPORT2
1039 udat_clone(const UDateFormat *fmt,
1040  UErrorCode *status);
1041 
1060 U_CAPI int32_t U_EXPORT2
1061 udat_format( const UDateFormat* format,
1062  UDate dateToFormat,
1063  UChar* result,
1064  int32_t resultLength,
1065  UFieldPosition* position,
1066  UErrorCode* status);
1067 
1090 U_CAPI int32_t U_EXPORT2
1091 udat_formatCalendar( const UDateFormat* format,
1092  UCalendar* calendar,
1093  UChar* result,
1094  int32_t capacity,
1095  UFieldPosition* position,
1096  UErrorCode* status);
1097 
1125 U_CAPI int32_t U_EXPORT2
1126 udat_formatForFields( const UDateFormat* format,
1127  UDate dateToFormat,
1128  UChar* result,
1129  int32_t resultLength,
1130  UFieldPositionIterator* fpositer,
1131  UErrorCode* status);
1132 
1163 U_CAPI int32_t U_EXPORT2
1165  UCalendar* calendar,
1166  UChar* result,
1167  int32_t capacity,
1168  UFieldPositionIterator* fpositer,
1169  UErrorCode* status);
1170 
1171 
1197 U_CAPI UDate U_EXPORT2
1198 udat_parse(const UDateFormat* format,
1199  const UChar* text,
1200  int32_t textLength,
1201  int32_t *parsePos,
1202  UErrorCode *status);
1203 
1225 U_CAPI void U_EXPORT2
1226 udat_parseCalendar(const UDateFormat* format,
1227  UCalendar* calendar,
1228  const UChar* text,
1229  int32_t textLength,
1230  int32_t *parsePos,
1231  UErrorCode *status);
1232 
1242 U_CAPI UBool U_EXPORT2
1243 udat_isLenient(const UDateFormat* fmt);
1244 
1254 U_CAPI void U_EXPORT2
1256  UBool isLenient);
1257 
1267 U_CAPI const UCalendar* U_EXPORT2
1268 udat_getCalendar(const UDateFormat* fmt);
1269 
1279 U_CAPI void U_EXPORT2
1281  const UCalendar* calendarToSet);
1282 
1292 U_CAPI const UNumberFormat* U_EXPORT2
1293 udat_getNumberFormat(const UDateFormat* fmt);
1294 
1304 U_CAPI const UNumberFormat* U_EXPORT2
1306 
1322 U_CAPI void U_EXPORT2
1324  const UChar* fields,
1325  UNumberFormat* numberFormatToSet,
1326  UErrorCode* status);
1339 U_CAPI void U_EXPORT2
1341  const UNumberFormat* numberFormatToSet);
1351 U_CAPI void U_EXPORT2
1353  UNumberFormat* numberFormatToAdopt);
1363 U_CAPI const char* U_EXPORT2
1364 udat_getAvailable(int32_t localeIndex);
1365 
1374 U_CAPI int32_t U_EXPORT2
1375 udat_countAvailable(void);
1376 
1387 U_CAPI UDate U_EXPORT2
1389  UErrorCode *status);
1390 
1401 U_CAPI void U_EXPORT2
1403  UDate d,
1404  UErrorCode *status);
1405 
1418 U_CAPI int32_t U_EXPORT2
1419 udat_toPattern( const UDateFormat *fmt,
1420  UBool localized,
1421  UChar *result,
1422  int32_t resultLength,
1423  UErrorCode *status);
1424 
1435 U_CAPI void U_EXPORT2
1437  UBool localized,
1438  const UChar *pattern,
1439  int32_t patternLength);
1440 
1471  UDAT_STANDALONE_SHORT_MONTHS,
1472  UDAT_STANDALONE_NARROW_MONTHS,
1488  UDAT_STANDALONE_SHORT_QUARTERS,
1537 
1538 struct UDateFormatSymbols;
1544 
1561 U_CAPI int32_t U_EXPORT2
1562 udat_getSymbols(const UDateFormat *fmt,
1563  UDateFormatSymbolType type,
1564  int32_t symbolIndex,
1565  UChar *result,
1566  int32_t resultLength,
1567  UErrorCode *status);
1568 
1581 U_CAPI int32_t U_EXPORT2
1582 udat_countSymbols( const UDateFormat *fmt,
1583  UDateFormatSymbolType type);
1584 
1600 U_CAPI void U_EXPORT2
1601 udat_setSymbols( UDateFormat *format,
1602  UDateFormatSymbolType type,
1603  int32_t symbolIndex,
1604  UChar *value,
1605  int32_t valueLength,
1606  UErrorCode *status);
1607 
1617 U_CAPI const char* U_EXPORT2
1619  ULocDataLocaleType type,
1620  UErrorCode* status);
1621 
1630 U_CAPI void U_EXPORT2
1632 
1642 U_CAPI UDisplayContext U_EXPORT2
1643 udat_getContext(const UDateFormat* fmt, UDisplayContextType type, UErrorCode* status);
1644 
1645 #ifndef U_HIDE_INTERNAL_API
1646 
1657 U_CAPI int32_t U_EXPORT2
1659  UChar *result,
1660  int32_t resultLength,
1661  UErrorCode *status);
1662 
1674 U_CAPI int32_t U_EXPORT2
1676  UChar *result,
1677  int32_t resultLength,
1678  UErrorCode *status);
1679 
1692 U_CAPI void U_EXPORT2
1694  const UChar *datePattern,
1695  int32_t datePatternLength,
1696  const UChar *timePattern,
1697  int32_t timePatternLength,
1698  UErrorCode *status);
1699 
1704 typedef UDateFormat* (U_EXPORT2 *UDateFormatOpener) (UDateFormatStyle timeStyle,
1705  UDateFormatStyle dateStyle,
1706  const char *locale,
1707  const UChar *tzID,
1708  int32_t tzIDLength,
1709  const UChar *pattern,
1710  int32_t patternLength,
1711  UErrorCode *status);
1712 
1717 U_CAPI void U_EXPORT2
1719 
1724 U_CAPI UDateFormatOpener U_EXPORT2
1726 #endif /* U_HIDE_INTERNAL_API */
1727 
1728 
1729 #endif /* #if !UCONFIG_NO_FORMATTING */
1730 
1731 #endif
UDAT_HOUR_OF_DAY1_FIELD
@ UDAT_HOUR_OF_DAY1_FIELD
FieldPosition and UFieldPosition selector for 'k' field alignment, corresponding to the UCAL_HOUR_OF_...
Definition: udat.h:551
UDAT_SHORT_MONTHS
@ UDAT_SHORT_MONTHS
The short month names, for example Feb.
Definition: udat.h:1451
UDAT_FIELD_COUNT
@ UDAT_FIELD_COUNT
Number of FieldPosition and UFieldPosition selectors for DateFormat and UDateFormat.
Definition: udat.h:822
UDAT_MINUTE_FIELD
@ UDAT_MINUTE_FIELD
FieldPosition and UFieldPosition selector for 'm' field alignment, corresponding to the UCAL_MINUTE f...
Definition: udat.h:567
UDateFormatField
UDateFormatField
FieldPosition and UFieldPosition selectors for format fields defined by DateFormat and UDateFormat.
Definition: udat.h:515
U_HIDE_INTERNAL_API
#define U_HIDE_INTERNAL_API
Definition: utypes.h:87
UDAT_STANDALONE_SHORT_WEEKDAYS
@ UDAT_STANDALONE_SHORT_WEEKDAYS
The CLDR-style stand-alone "abbreviated" (not "short") weekday names.
Definition: udat.h:1479
UDAT_NARROW_MONTHS
@ UDAT_NARROW_MONTHS
The narrow month names, for example F.
Definition: udat.h:1466
udat_registerOpener
U_CAPI void udat_registerOpener(UDateFormatOpener opener, UErrorCode *status)
Register a provider factory.
UDAT_HOUR_CYCLE_23
@ UDAT_HOUR_CYCLE_23
Hour in day (0~23)
Definition: udat.h:1001
UDAT_JULIAN_DAY_FIELD
@ UDAT_JULIAN_DAY_FIELD
FieldPosition and UFieldPosition selector for 'g' field alignment, corresponding to the UCAL_JULIAN_D...
Definition: udat.h:685
UDAT_PARSE_ALLOW_NUMERIC
@ UDAT_PARSE_ALLOW_NUMERIC
indicates tolerance of numeric data when String data may be assumed.
Definition: udat.h:928
udat_adoptNumberFormatForFields
U_CAPI void udat_adoptNumberFormatForFields(UDateFormat *fmt, const UChar *fields, UNumberFormat *numberFormatToSet, UErrorCode *status)
Set the UNumberFormat for specific field associated with an UDateFormat.
UDAT_STANDALONE_WEEKDAYS
@ UDAT_STANDALONE_WEEKDAYS
The CLDR-style stand-alone "wide" weekday names.
Definition: udat.h:1474
UDAT_CYCLIC_YEARS_ABBREVIATED
@ UDAT_CYCLIC_YEARS_ABBREVIATED
Cyclic year names (only supported for some calendars, and only for FORMAT usage)
Definition: udat.h:1512
UDAT_TIMEZONE_ISO_LOCAL_FIELD
@ UDAT_TIMEZONE_ISO_LOCAL_FIELD
FieldPosition selector for 'x' field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
Definition: udat.h:780
UDAT_STANDALONE_QUARTER_FIELD
@ UDAT_STANDALONE_QUARTER_FIELD
FieldPosition selector for the "q" field alignment, corresponding to stand-alone quarters.
Definition: udat.h:740
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
udat_getContext
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...
UDAT_FRACTIONAL_SECOND_FIELD
@ UDAT_FRACTIONAL_SECOND_FIELD
FieldPosition and UFieldPosition selector for 'S' field alignment, corresponding to the UCAL_MILLISEC...
Definition: udat.h:589
UDAT_TIMEZONE_FIELD
@ UDAT_TIMEZONE_FIELD
FieldPosition and UFieldPosition selector for 'z' field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:657
udat_getLocaleByType
const U_CAPI char * udat_getLocaleByType(const UDateFormat *fmt, ULocDataLocaleType type, UErrorCode *status)
Get the locale for this date format object.
UDAT_YEAR_NAME_FIELD
@ UDAT_YEAR_NAME_FIELD
FieldPosition selector for "U" field alignment, corresponding to cyclic year names.
Definition: udat.h:756
UDAT_HOUR_CYCLE_12
@ UDAT_HOUR_CYCLE_12
Hour in am/pm (1~12)
Definition: udat.h:995
UDAT_STANDALONE_DAY_FIELD
@ UDAT_STANDALONE_DAY_FIELD
FieldPosition selector for 'c' field alignment, corresponding to the UCAL_DOW_LOCAL field.
Definition: udat.h:714
UDAT_PATTERN
@ UDAT_PATTERN
Use the pattern given in the parameter to udat_open.
Definition: udat.h:194
UDAT_DATE_FIELD
@ UDAT_DATE_FIELD
FieldPosition and UFieldPosition selector for 'd' field alignment, corresponding to the UCAL_DATE fie...
Definition: udat.h:542
UBool
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition: umachine.h:269
UDAT_DEFAULT
@ UDAT_DEFAULT
Default style.
Definition: udat.h:172
UDAT_STANDALONE_SHORTER_WEEKDAYS
@ UDAT_STANDALONE_SHORTER_WEEKDAYS
Standalone version of UDAT_SHORTER_WEEKDAYS.
Definition: udat.h:1501
udat_setCalendar
U_CAPI void udat_setCalendar(UDateFormat *fmt, const UCalendar *calendarToSet)
Set the UCalendar associated with an UDateFormat.
ULocDataLocaleType
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested,...
Definition: uloc.h:338
UDAT_YEAR_WOY_FIELD
@ UDAT_YEAR_WOY_FIELD
FieldPosition and UFieldPosition selector for 'Y' field alignment, corresponding to the UCAL_YEAR_WOY...
Definition: udat.h:664
UDAT_RELATIVE
@ UDAT_RELATIVE
Bitfield for relative date.
Definition: udat.h:175
UDateFormatOpener
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:1704
udat_getBooleanAttribute
U_CAPI UBool udat_getBooleanAttribute(const UDateFormat *fmt, UDateFormatBooleanAttribute attr, UErrorCode *status)
Get a boolean attribute associated with a UDateFormat.
UDAT_DAY_OF_YEAR_FIELD
@ UDAT_DAY_OF_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'D' field alignment, corresponding to the UCAL_DAY_OF_Y...
Definition: udat.h:603
udat_parse
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.
UDAT_DOW_LOCAL_FIELD
@ UDAT_DOW_LOCAL_FIELD
FieldPosition and UFieldPosition selector for 'e' field alignment, corresponding to the UCAL_DOW_LOCA...
Definition: udat.h:671
udat_toPatternRelativeDate
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.
UDAT_EXTENDED_YEAR_FIELD
@ UDAT_EXTENDED_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'u' field alignment, corresponding to the UCAL_EXTENDED...
Definition: udat.h:678
UDAT_RELATED_YEAR_FIELD
@ UDAT_RELATED_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'r' field alignment, no directly corresponding UCAL_ fi...
Definition: udat.h:788
UDateFormat
void * UDateFormat
A date formatter.
Definition: udat.h:157
udat_formatCalendar
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.
UDateFormatSymbols
struct UDateFormatSymbols UDateFormatSymbols
Date format symbols.
Definition: udat.h:1543
UDAT_HOUR1_FIELD
@ UDAT_HOUR1_FIELD
FieldPosition and UFieldPosition selector for 'h' field alignment, corresponding to the UCAL_HOUR fie...
Definition: udat.h:640
UDAT_IGNORE
@ UDAT_IGNORE
Definition: udat.h:198
UDAT_HOUR_CYCLE_11
@ UDAT_HOUR_CYCLE_11
Hour in am/pm (0~11)
Definition: udat.h:989
UDAT_MONTHS
@ UDAT_MONTHS
The month names, for example February.
Definition: udat.h:1449
UDAT_SHORTER_WEEKDAYS
@ UDAT_SHORTER_WEEKDAYS
The CLDR-style short weekday names, e.g.
Definition: udat.h:1496
udat_getCalendar
const U_CAPI UCalendar * udat_getCalendar(const UDateFormat *fmt)
Get the UCalendar associated with an UDateFormat.
UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD
@ 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:764
udat_toPattern
U_CAPI int32_t udat_toPattern(const UDateFormat *fmt, UBool localized, UChar *result, int32_t resultLength, UErrorCode *status)
Extract the pattern from a UDateFormat.
UDateFormatBooleanAttribute
UDateFormatBooleanAttribute
DateFormat boolean attributes.
Definition: udat.h:917
UDAT_PARSE_PARTIAL_LITERAL_MATCH
@ UDAT_PARSE_PARTIAL_LITERAL_MATCH
indicates tolerance of a partial literal match e.g.
Definition: udat.h:934
UDAT_TIMEZONE_SPECIAL_FIELD
@ UDAT_TIMEZONE_SPECIAL_FIELD
FieldPosition and UFieldPosition selector for 'V' field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:747
UDAT_NARROW_WEEKDAYS
@ UDAT_NARROW_WEEKDAYS
The CLDR-style format "narrow" weekday names, for example "M".
Definition: udat.h:1468
udat_setContext
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...
UDisplayContextType
UDisplayContextType
Display context types, for getting values of a particular setting.
Definition: udisplaycontext.h:27
udat_get2DigitYearStart
U_CAPI UDate udat_get2DigitYearStart(const UDateFormat *fmt, UErrorCode *status)
Get the year relative to which all 2-digit years are interpreted.
UFieldPositionIterator
struct UFieldPositionIterator UFieldPositionIterator
C typedef for struct UFieldPositionIterator.
Definition: ufieldpositer.h:46
udat_applyPatternRelative
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.
udat_applyPattern
U_CAPI void udat_applyPattern(UDateFormat *format, UBool localized, const UChar *pattern, int32_t patternLength)
Set the pattern used by an UDateFormat.
UDAT_MILLISECONDS_IN_DAY_FIELD
@ UDAT_MILLISECONDS_IN_DAY_FIELD
FieldPosition and UFieldPosition selector for 'A' field alignment, corresponding to the UCAL_MILLISEC...
Definition: udat.h:692
UDAT_LOCALIZED_CHARS
@ UDAT_LOCALIZED_CHARS
The localized characters.
Definition: udat.h:1462
unum.h
C API: Compatibility APIs for number formatting.
UDAT_LONG
@ UDAT_LONG
Long style.
Definition: udat.h:166
UDAT_ZODIAC_NAMES_WIDE
@ UDAT_ZODIAC_NAMES_WIDE
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols ...
Definition: udat.h:1524
UDAT_DAY_OF_WEEK_FIELD
@ UDAT_DAY_OF_WEEK_FIELD
FieldPosition and UFieldPosition selector for 'E' field alignment, corresponding to the UCAL_DAY_OF_W...
Definition: udat.h:596
udat_format
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.
UDAT_TIMEZONE_ISO_FIELD
@ UDAT_TIMEZONE_ISO_FIELD
FieldPosition selector for 'X' field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
Definition: udat.h:772
UDAT_HOUR0_FIELD
@ UDAT_HOUR0_FIELD
FieldPosition and UFieldPosition selector for 'K' field alignment, corresponding to the UCAL_HOUR fie...
Definition: udat.h:649
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
UDateFormatHourCycle
UDateFormatHourCycle
Hour Cycle.
Definition: udat.h:984
UDAT_ERA_NAMES
@ UDAT_ERA_NAMES
The long era names, for example Anno Domini.
Definition: udat.h:1464
udat_setLenient
U_CAPI void udat_setLenient(UDateFormat *fmt, UBool isLenient)
Specify whether an UDateFormat will perform lenient parsing.
UDAT_QUARTERS
@ UDAT_QUARTERS
The quarters, for example 1st Quarter.
Definition: udat.h:1483
UDAT_NONE
@ UDAT_NONE
No style.
Definition: udat.h:187
ucal.h
C API: Calendar.
udat_getSymbols
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.
udat_clone
U_CAPI UDateFormat * udat_clone(const UDateFormat *fmt, UErrorCode *status)
Open a copy of a UDateFormat.
udat_getNumberFormat
const U_CAPI UNumberFormat * udat_getNumberFormat(const UDateFormat *fmt)
Get the UNumberFormat associated with an UDateFormat.
UDAT_BOOLEAN_ATTRIBUTE_COUNT
@ UDAT_BOOLEAN_ATTRIBUTE_COUNT
One more than the highest normal UDateFormatBooleanAttribute value.
Definition: udat.h:949
UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH
@ UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH
indicates tolerance of pattern mismatch between input data and specified format pattern.
Definition: udat.h:940
UDAT_FULL
@ UDAT_FULL
Full style.
Definition: udat.h:164
udat_countAvailable
U_CAPI int32_t udat_countAvailable(void)
Determine how many locales have date/time formatting patterns available.
UDAT_TIME_SEPARATOR_FIELD
@ UDAT_TIME_SEPARATOR_FIELD
FieldPosition and UFieldPosition selector for time separator, no corresponding UCAL_ field.
Definition: udat.h:812
ufieldpositer.h
C API: UFieldPositionIterator for use with format APIs.
UDAT_DAY_OF_WEEK_IN_MONTH_FIELD
@ 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:610
UDAT_STANDALONE_MONTH_FIELD
@ UDAT_STANDALONE_MONTH_FIELD
FieldPosition selector for 'L' field alignment, corresponding to the UCAL_MONTH field.
Definition: udat.h:722
UDAT_YEAR_FIELD
@ UDAT_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'y' field alignment, corresponding to the UCAL_YEAR fie...
Definition: udat.h:528
UDAT_STANDALONE_NARROW_WEEKDAYS
@ UDAT_STANDALONE_NARROW_WEEKDAYS
The CLDR-style stand-alone "narrow" weekday names.
Definition: udat.h:1481
udat_setNumberFormat
U_CAPI void udat_setNumberFormat(UDateFormat *fmt, const UNumberFormat *numberFormatToSet)
Set the UNumberFormat associated with an UDateFormat.
U_DEFINE_LOCAL_OPEN_POINTER
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
Definition: localpointer.h:550
UFieldPosition
A struct representing a range of text containing a specific field.
Definition: umisc.h:34
udat_toCalendarDateField
U_CAPI UCalendarDateFields udat_toCalendarDateField(UDateFormatField field)
Maps from a UDateFormatField to the corresponding UCalendarDateFields.
udat_unregisterOpener
U_CAPI UDateFormatOpener udat_unregisterOpener(UDateFormatOpener opener, UErrorCode *status)
Un-Register a provider factory.
udat_setBooleanAttribute
U_CAPI void udat_setBooleanAttribute(UDateFormat *fmt, UDateFormatBooleanAttribute attr, UBool newValue, UErrorCode *status)
Set a boolean attribute associated with a UDateFormat.
UDAT_TIMEZONE_GENERIC_FIELD
@ UDAT_TIMEZONE_GENERIC_FIELD
FieldPosition and UFieldPosition selector for 'v' field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:707
UDAT_SECOND_FIELD
@ UDAT_SECOND_FIELD
FieldPosition and UFieldPosition selector for 's' field alignment, corresponding to the UCAL_SECOND f...
Definition: udat.h:574
udat_close
U_CAPI void udat_close(UDateFormat *format)
Close a UDateFormat.
UDAT_ERAS
@ UDAT_ERAS
The era names, for example AD.
Definition: udat.h:1447
udat_formatCalendarForFields
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.
UDAT_AM_PMS
@ UDAT_AM_PMS
The AM/PM names, for example AM.
Definition: udat.h:1460
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
UCalendar
void * UCalendar
A calendar.
Definition: ucal.h:172
LocalUDateFormatPointer
UDAT_CYCLIC_YEARS_WIDE
@ UDAT_CYCLIC_YEARS_WIDE
Cyclic year names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols not ...
Definition: udat.h:1507
UDate
double UDate
Date and Time data type.
Definition: utypes.h:203
UDAT_TIMEZONE_RFC_FIELD
@ UDAT_TIMEZONE_RFC_FIELD
FieldPosition and UFieldPosition selector for 'Z' field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:700
UDAT_PARSE_ALLOW_WHITESPACE
@ UDAT_PARSE_ALLOW_WHITESPACE
indicates whether whitespace is allowed.
Definition: udat.h:922
udat_toPatternRelativeTime
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.
UDateFormatStyle
UDateFormatStyle
The possible date/time format styles.
Definition: udat.h:162
UDAT_WEEK_OF_YEAR_FIELD
@ UDAT_WEEK_OF_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'w' field alignment, corresponding to the UCAL_WEEK_OF_...
Definition: udat.h:617
udat_countSymbols
U_CAPI int32_t udat_countSymbols(const UDateFormat *fmt, UDateFormatSymbolType type)
Count the number of particular symbols for an UDateFormat.
UDAT_HOUR_OF_DAY0_FIELD
@ UDAT_HOUR_OF_DAY0_FIELD
FieldPosition and UFieldPosition selector for 'H' field alignment, corresponding to the UCAL_HOUR_OF_...
Definition: udat.h:560
UDisplayContext
UDisplayContext
Display context settings.
Definition: udisplaycontext.h:64
UNumberFormat
void * UNumberFormat
A number formatter.
Definition: unum.h:144
udat_formatForFields
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.
udat_adoptNumberFormat
U_CAPI void udat_adoptNumberFormat(UDateFormat *fmt, UNumberFormat *numberFormatToAdopt)
Adopt the UNumberFormat associated with an UDateFormat.
UDAT_HOUR_CYCLE_24
@ UDAT_HOUR_CYCLE_24
Hour in day (1~24)
Definition: udat.h:1007
udat_getNumberFormatForField
const U_CAPI UNumberFormat * udat_getNumberFormatForField(const UDateFormat *fmt, UChar field)
Get the UNumberFormat for specific field associated with an UDateFormat.
UDAT_ZODIAC_NAMES_ABBREVIATED
@ UDAT_ZODIAC_NAMES_ABBREVIATED
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage)
Definition: udat.h:1529
UCalendarDateFields
UCalendarDateFields
Possible fields in a UCalendar.
Definition: ucal.h:202
UDAT_SHORT_QUARTERS
@ UDAT_SHORT_QUARTERS
The short quarter names, for example Q1.
Definition: udat.h:1485
udat_set2DigitYearStart
U_CAPI void udat_set2DigitYearStart(UDateFormat *fmt, UDate d, UErrorCode *status)
Set the year relative to which all 2-digit years will be interpreted.
udat_isLenient
U_CAPI UBool udat_isLenient(const UDateFormat *fmt)
Determine if an UDateFormat will perform lenient parsing.
UChar
char16_t UChar
Definition: umachine.h:418
UDAT_MEDIUM
@ UDAT_MEDIUM
Medium style.
Definition: udat.h:168
UDateFormatSymbolType
UDateFormatSymbolType
The possible types of date format symbols.
Definition: udat.h:1445
udisplaycontext.h
C API: Display context types (enum values)
UDAT_QUARTER_FIELD
@ UDAT_QUARTER_FIELD
FieldPosition selector for "Q" field alignment, corresponding to quarters.
Definition: udat.h:731
UDAT_WEEK_OF_MONTH_FIELD
@ UDAT_WEEK_OF_MONTH_FIELD
FieldPosition and UFieldPosition selector for 'W' field alignment, corresponding to the UCAL_WEEK_OF_...
Definition: udat.h:624
UDAT_WEEKDAYS
@ UDAT_WEEKDAYS
The CLDR-style format "wide" weekday names, for example Monday.
Definition: udat.h:1453
UDAT_AM_PM_MIDNIGHT_NOON_FIELD
@ UDAT_AM_PM_MIDNIGHT_NOON_FIELD
FieldPosition selector for 'b' field alignment.
Definition: udat.h:797
U_CAPI
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition: umachine.h:110
UDAT_ERA_FIELD
@ UDAT_ERA_FIELD
FieldPosition and UFieldPosition selector for 'G' field alignment, corresponding to the UCAL_ERA fiel...
Definition: udat.h:521
udat_parseCalendar
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.
UDAT_ZODIAC_NAMES_NARROW
@ UDAT_ZODIAC_NAMES_NARROW
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols ...
Definition: udat.h:1535
UDAT_AM_PM_FIELD
@ UDAT_AM_PM_FIELD
FieldPosition and UFieldPosition selector for 'a' field alignment, corresponding to the UCAL_AM_PM fi...
Definition: udat.h:631
UDAT_STANDALONE_MONTHS
@ UDAT_STANDALONE_MONTHS
Standalone context versions of months.
Definition: udat.h:1470
UDAT_CYCLIC_YEARS_NARROW
@ UDAT_CYCLIC_YEARS_NARROW
Cyclic year names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols not ...
Definition: udat.h:1518
udat_getAvailable
const U_CAPI char * udat_getAvailable(int32_t localeIndex)
Get a locale for which date/time formatting patterns are available.
UDAT_SHORT
@ UDAT_SHORT
Short style.
Definition: udat.h:170
udat_open
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.
udat_setSymbols
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.
UDAT_MONTH_FIELD
@ UDAT_MONTH_FIELD
FieldPosition and UFieldPosition selector for 'M' field alignment, corresponding to the UCAL_MONTH fi...
Definition: udat.h:535
UDAT_STANDALONE_QUARTERS
@ UDAT_STANDALONE_QUARTERS
Standalone context versions of quarters.
Definition: udat.h:1487
UDAT_SHORT_WEEKDAYS
@ UDAT_SHORT_WEEKDAYS
The CLDR-style format "abbreviated" (not "short") weekday names, for example "Mon....
Definition: udat.h:1458