ICU 62.1  62.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"
205 
209 #define UDAT_QUARTER "QQQQ"
210 
214 #define UDAT_ABBR_QUARTER "QQQ"
215 
219 #define UDAT_YEAR_QUARTER "yQQQQ"
220 
224 #define UDAT_YEAR_ABBR_QUARTER "yQQQ"
225 
229 #define UDAT_MONTH "MMMM"
230 
234 #define UDAT_ABBR_MONTH "MMM"
235 
239 #define UDAT_NUM_MONTH "M"
240 
244 #define UDAT_YEAR_MONTH "yMMMM"
245 
249 #define UDAT_YEAR_ABBR_MONTH "yMMM"
250 
254 #define UDAT_YEAR_NUM_MONTH "yM"
255 
259 #define UDAT_DAY "d"
260 
265 #define UDAT_YEAR_MONTH_DAY "yMMMMd"
266 
271 #define UDAT_YEAR_ABBR_MONTH_DAY "yMMMd"
272 
277 #define UDAT_YEAR_NUM_MONTH_DAY "yMd"
278 
282 #define UDAT_WEEKDAY "EEEE"
283 
287 #define UDAT_ABBR_WEEKDAY "E"
288 
293 #define UDAT_YEAR_MONTH_WEEKDAY_DAY "yMMMMEEEEd"
294 
299 #define UDAT_YEAR_ABBR_MONTH_WEEKDAY_DAY "yMMMEd"
300 
305 #define UDAT_YEAR_NUM_MONTH_WEEKDAY_DAY "yMEd"
306 
311 #define UDAT_MONTH_DAY "MMMMd"
312 
317 #define UDAT_ABBR_MONTH_DAY "MMMd"
318 
323 #define UDAT_NUM_MONTH_DAY "Md"
324 
329 #define UDAT_MONTH_WEEKDAY_DAY "MMMMEEEEd"
330 
335 #define UDAT_ABBR_MONTH_WEEKDAY_DAY "MMMEd"
336 
341 #define UDAT_NUM_MONTH_WEEKDAY_DAY "MEd"
342 
343 /* Skeletons for times. */
344 
349 #define UDAT_HOUR "j"
350 
354 #define UDAT_HOUR24 "H"
355 
359 #define UDAT_MINUTE "m"
360 
365 #define UDAT_HOUR_MINUTE "jm"
366 
371 #define UDAT_HOUR24_MINUTE "Hm"
372 
376 #define UDAT_SECOND "s"
377 
383 #define UDAT_HOUR_MINUTE_SECOND "jms"
384 
390 #define UDAT_HOUR24_MINUTE_SECOND "Hms"
391 
396 #define UDAT_MINUTE_SECOND "ms"
397 
398 /* Skeletons for time zones. */
399 
407 #define UDAT_LOCATION_TZ "VVVV"
408 
415 #define UDAT_GENERIC_TZ "vvvv"
416 
423 #define UDAT_ABBR_GENERIC_TZ "v"
424 
431 #define UDAT_SPECIFIC_TZ "zzzz"
432 
439 #define UDAT_ABBR_SPECIFIC_TZ "z"
440 
447 #define UDAT_ABBR_UTC_TZ "ZZZZ"
448 
449 /* deprecated skeleton constants */
450 
451 #ifndef U_HIDE_DEPRECATED_API
452 
456 #define UDAT_STANDALONE_MONTH "LLLL"
457 
461 #define UDAT_ABBR_STANDALONE_MONTH "LLL"
462 
467 #define UDAT_HOUR_MINUTE_GENERIC_TZ "jmv"
468 
472 #define UDAT_HOUR_MINUTE_TZ "jmz"
473 
477 #define UDAT_HOUR_GENERIC_TZ "jv"
478 
482 #define UDAT_HOUR_TZ "jz"
483 #endif /* U_HIDE_DEPRECATED_API */
484 
490 typedef enum UDateFormatField {
497 
504 
511 
518 
527 
536 
543 
550 
565 
572 
579 
586 
593 
600 
607 
616 
625 
633 
640 
647 
654 
661 
668 
676 
690 
698 
707 
716 
723 
732 
740 
748 
756 
757 #ifndef U_HIDE_INTERNAL_API
758 
764 #endif /* U_HIDE_INTERNAL_API */
765 
773 
774  /* FieldPosition selector for 'B' field alignment.
775  * Displays flexible day periods, such as "in the morning", if available.
776  * @stable ICU 57
777  */
778  UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36,
779 
780 #ifndef U_HIDE_INTERNAL_API
781 
788 #endif /* U_HIDE_INTERNAL_API */
789 
790 #ifndef U_HIDE_DEPRECATED_API
791 
798 #endif /* U_HIDE_DEPRECATED_API */
800 
801 
802 #ifndef U_HIDE_INTERNAL_API
803 
808 #define UDAT_HAS_PATTERN_CHAR_FOR_TIME_SEPARATOR 0
809 #endif /* U_HIDE_INTERNAL_API */
810 
811 
820 U_CAPI UCalendarDateFields U_EXPORT2
822 
823 
852 U_CAPI UDateFormat* U_EXPORT2
853 udat_open(UDateFormatStyle timeStyle,
854  UDateFormatStyle dateStyle,
855  const char *locale,
856  const UChar *tzID,
857  int32_t tzIDLength,
858  const UChar *pattern,
859  int32_t patternLength,
860  UErrorCode *status);
861 
862 
869 U_CAPI void U_EXPORT2
870 udat_close(UDateFormat* format);
871 
872 
902 
903  /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
904  * it is needed for layout of DateFormat object. */
911 
922 U_CAPI UBool U_EXPORT2
924 
935 U_CAPI void U_EXPORT2
937 
938 
939 
940 #if U_SHOW_CPLUSPLUS_API
941 
943 
954 
956 
957 #endif
958 
967 U_CAPI UDateFormat* U_EXPORT2
968 udat_clone(const UDateFormat *fmt,
969  UErrorCode *status);
970 
989 U_CAPI int32_t U_EXPORT2
990 udat_format( const UDateFormat* format,
991  UDate dateToFormat,
992  UChar* result,
993  int32_t resultLength,
994  UFieldPosition* position,
995  UErrorCode* status);
996 
1019 U_CAPI int32_t U_EXPORT2
1020 udat_formatCalendar( const UDateFormat* format,
1021  UCalendar* calendar,
1022  UChar* result,
1023  int32_t capacity,
1024  UFieldPosition* position,
1025  UErrorCode* status);
1026 
1054 U_CAPI int32_t U_EXPORT2
1055 udat_formatForFields( const UDateFormat* format,
1056  UDate dateToFormat,
1057  UChar* result,
1058  int32_t resultLength,
1059  UFieldPositionIterator* fpositer,
1060  UErrorCode* status);
1061 
1092 U_CAPI int32_t U_EXPORT2
1094  UCalendar* calendar,
1095  UChar* result,
1096  int32_t capacity,
1097  UFieldPositionIterator* fpositer,
1098  UErrorCode* status);
1099 
1100 
1126 U_CAPI UDate U_EXPORT2
1127 udat_parse(const UDateFormat* format,
1128  const UChar* text,
1129  int32_t textLength,
1130  int32_t *parsePos,
1131  UErrorCode *status);
1132 
1154 U_CAPI void U_EXPORT2
1155 udat_parseCalendar(const UDateFormat* format,
1156  UCalendar* calendar,
1157  const UChar* text,
1158  int32_t textLength,
1159  int32_t *parsePos,
1160  UErrorCode *status);
1161 
1171 U_CAPI UBool U_EXPORT2
1172 udat_isLenient(const UDateFormat* fmt);
1173 
1183 U_CAPI void U_EXPORT2
1185  UBool isLenient);
1186 
1196 U_CAPI const UCalendar* U_EXPORT2
1197 udat_getCalendar(const UDateFormat* fmt);
1198 
1208 U_CAPI void U_EXPORT2
1210  const UCalendar* calendarToSet);
1211 
1221 U_CAPI const UNumberFormat* U_EXPORT2
1222 udat_getNumberFormat(const UDateFormat* fmt);
1223 
1233 U_CAPI const UNumberFormat* U_EXPORT2
1235 
1251 U_CAPI void U_EXPORT2
1253  const UChar* fields,
1254  UNumberFormat* numberFormatToSet,
1255  UErrorCode* status);
1268 U_CAPI void U_EXPORT2
1270  const UNumberFormat* numberFormatToSet);
1280 U_CAPI void U_EXPORT2
1282  UNumberFormat* numberFormatToAdopt);
1292 U_CAPI const char* U_EXPORT2
1293 udat_getAvailable(int32_t localeIndex);
1294 
1303 U_CAPI int32_t U_EXPORT2
1304 udat_countAvailable(void);
1305 
1316 U_CAPI UDate U_EXPORT2
1318  UErrorCode *status);
1319 
1330 U_CAPI void U_EXPORT2
1332  UDate d,
1333  UErrorCode *status);
1334 
1347 U_CAPI int32_t U_EXPORT2
1348 udat_toPattern( const UDateFormat *fmt,
1349  UBool localized,
1350  UChar *result,
1351  int32_t resultLength,
1352  UErrorCode *status);
1353 
1364 U_CAPI void U_EXPORT2
1366  UBool localized,
1367  const UChar *pattern,
1368  int32_t patternLength);
1369 
1400  UDAT_STANDALONE_SHORT_MONTHS,
1401  UDAT_STANDALONE_NARROW_MONTHS,
1417  UDAT_STANDALONE_SHORT_QUARTERS,
1466 
1467 struct UDateFormatSymbols;
1473 
1490 U_CAPI int32_t U_EXPORT2
1491 udat_getSymbols(const UDateFormat *fmt,
1492  UDateFormatSymbolType type,
1493  int32_t symbolIndex,
1494  UChar *result,
1495  int32_t resultLength,
1496  UErrorCode *status);
1497 
1510 U_CAPI int32_t U_EXPORT2
1511 udat_countSymbols( const UDateFormat *fmt,
1512  UDateFormatSymbolType type);
1513 
1529 U_CAPI void U_EXPORT2
1530 udat_setSymbols( UDateFormat *format,
1531  UDateFormatSymbolType type,
1532  int32_t symbolIndex,
1533  UChar *value,
1534  int32_t valueLength,
1535  UErrorCode *status);
1536 
1546 U_CAPI const char* U_EXPORT2
1548  ULocDataLocaleType type,
1549  UErrorCode* status);
1550 
1559 U_CAPI void U_EXPORT2
1561 
1571 U_CAPI UDisplayContext U_EXPORT2
1572 udat_getContext(const UDateFormat* fmt, UDisplayContextType type, UErrorCode* status);
1573 
1574 #ifndef U_HIDE_INTERNAL_API
1575 
1586 U_INTERNAL int32_t U_EXPORT2
1588  UChar *result,
1589  int32_t resultLength,
1590  UErrorCode *status);
1591 
1603 U_INTERNAL int32_t U_EXPORT2
1605  UChar *result,
1606  int32_t resultLength,
1607  UErrorCode *status);
1608 
1621 U_INTERNAL void U_EXPORT2
1623  const UChar *datePattern,
1624  int32_t datePatternLength,
1625  const UChar *timePattern,
1626  int32_t timePatternLength,
1627  UErrorCode *status);
1628 
1633 typedef UDateFormat* (U_EXPORT2 *UDateFormatOpener) (UDateFormatStyle timeStyle,
1634  UDateFormatStyle dateStyle,
1635  const char *locale,
1636  const UChar *tzID,
1637  int32_t tzIDLength,
1638  const UChar *pattern,
1639  int32_t patternLength,
1640  UErrorCode *status);
1641 
1646 U_INTERNAL void U_EXPORT2
1648 
1653 U_INTERNAL UDateFormatOpener U_EXPORT2
1655 #endif /* U_HIDE_INTERNAL_API */
1656 
1657 
1658 #endif /* #if !UCONFIG_NO_FORMATTING */
1659 
1660 #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:526
UDAT_SHORT_MONTHS
@ UDAT_SHORT_MONTHS
The short month names, for example Feb.
Definition: udat.h:1380
UDAT_FIELD_COUNT
@ UDAT_FIELD_COUNT
Number of FieldPosition and UFieldPosition selectors for DateFormat and UDateFormat.
Definition: udat.h:797
UDAT_MINUTE_FIELD
@ UDAT_MINUTE_FIELD
FieldPosition and UFieldPosition selector for 'm' field alignment, corresponding to the UCAL_MINUTE f...
Definition: udat.h:542
UDateFormatField
UDateFormatField
FieldPosition and UFieldPosition selectors for format fields defined by DateFormat and UDateFormat.
Definition: udat.h:490
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:1408
UDAT_NARROW_MONTHS
@ UDAT_NARROW_MONTHS
The narrow month names, for example F.
Definition: udat.h:1395
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:660
UDAT_PARSE_ALLOW_NUMERIC
@ UDAT_PARSE_ALLOW_NUMERIC
indicates tolerance of numeric data when String data may be assumed.
Definition: udat.h:889
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:1403
UDAT_CYCLIC_YEARS_ABBREVIATED
@ UDAT_CYCLIC_YEARS_ABBREVIATED
Cyclic year names (only supported for some calendars, and only for FORMAT usage)
Definition: udat.h:1441
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:755
UDAT_STANDALONE_QUARTER_FIELD
@ UDAT_STANDALONE_QUARTER_FIELD
FieldPosition selector for the "q" field alignment, corresponding to stand-alone quarters.
Definition: udat.h:715
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:564
UDAT_TIMEZONE_FIELD
@ UDAT_TIMEZONE_FIELD
FieldPosition and UFieldPosition selector for 'z' field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:632
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:731
UDAT_STANDALONE_DAY_FIELD
@ UDAT_STANDALONE_DAY_FIELD
FieldPosition selector for 'c' field alignment, corresponding to the UCAL_DOW_LOCAL field.
Definition: udat.h:689
UDAT_PATTERN
@ UDAT_PATTERN
Use the pattern given in the parameter to udat_open.
Definition: udat.h:190
UDAT_DATE_FIELD
@ UDAT_DATE_FIELD
FieldPosition and UFieldPosition selector for 'd' field alignment, corresponding to the UCAL_DATE fie...
Definition: udat.h:517
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:236
UDAT_DEFAULT
@ UDAT_DEFAULT
Default style.
Definition: udat.h:168
UDAT_STANDALONE_SHORTER_WEEKDAYS
@ UDAT_STANDALONE_SHORTER_WEEKDAYS
Standalone version of UDAT_SHORTER_WEEKDAYS.
Definition: udat.h:1430
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:639
UDAT_RELATIVE
@ UDAT_RELATIVE
Bitfield for relative date.
Definition: udat.h:171
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:1633
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:578
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:646
UDAT_EXTENDED_YEAR_FIELD
@ UDAT_EXTENDED_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'u' field alignment, corresponding to the UCAL_EXTENDED...
Definition: udat.h:653
UDAT_RELATED_YEAR_FIELD
@ UDAT_RELATED_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'r' field alignment, no directly corresponding UCAL_ fi...
Definition: udat.h:763
UDateFormat
void * UDateFormat
A date formatter.
Definition: udat.h:153
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:1472
UDAT_HOUR1_FIELD
@ UDAT_HOUR1_FIELD
FieldPosition and UFieldPosition selector for 'h' field alignment, corresponding to the UCAL_HOUR fie...
Definition: udat.h:615
UDAT_IGNORE
@ UDAT_IGNORE
Definition: udat.h:194
UDAT_MONTHS
@ UDAT_MONTHS
The month names, for example February.
Definition: udat.h:1378
UDAT_SHORTER_WEEKDAYS
@ UDAT_SHORTER_WEEKDAYS
The CLDR-style short weekday names, e.g.
Definition: udat.h:1425
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:739
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:878
UDAT_PARSE_PARTIAL_LITERAL_MATCH
@ UDAT_PARSE_PARTIAL_LITERAL_MATCH
indicates tolerance of a partial literal match e.g.
Definition: udat.h:895
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:722
UDAT_NARROW_WEEKDAYS
@ UDAT_NARROW_WEEKDAYS
The CLDR-style format "narrow" weekday names, for example "M".
Definition: udat.h:1397
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:44
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:667
UDAT_LOCALIZED_CHARS
@ UDAT_LOCALIZED_CHARS
The localized characters.
Definition: udat.h:1391
udat_unregisterOpener
UDateFormatOpener udat_unregisterOpener(UDateFormatOpener opener, UErrorCode *status)
Un-Register a provider factory.
unum.h
C API: Compatibility APIs for number formatting.
UDAT_LONG
@ UDAT_LONG
Long style.
Definition: udat.h:162
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:1453
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:571
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:747
UDAT_HOUR0_FIELD
@ UDAT_HOUR0_FIELD
FieldPosition and UFieldPosition selector for 'K' field alignment, corresponding to the UCAL_HOUR fie...
Definition: udat.h:624
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition: utypes.h:396
UDAT_ERA_NAMES
@ UDAT_ERA_NAMES
The long era names, for example Anno Domini.
Definition: udat.h:1393
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:1412
UDAT_NONE
@ UDAT_NONE
No style.
Definition: udat.h:183
ucal.h
C API: Calendar.
U_INTERNAL
#define U_INTERNAL
This is used to declare a function as an internal ICU C API
Definition: umachine.h:119
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:909
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:901
UDAT_FULL
@ UDAT_FULL
Full style.
Definition: udat.h:160
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:787
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:585
UDAT_STANDALONE_MONTH_FIELD
@ UDAT_STANDALONE_MONTH_FIELD
FieldPosition selector for 'L' field alignment, corresponding to the UCAL_MONTH field.
Definition: udat.h:697
UDAT_YEAR_FIELD
@ UDAT_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'y' field alignment, corresponding to the UCAL_YEAR fie...
Definition: udat.h:503
UDAT_STANDALONE_NARROW_WEEKDAYS
@ UDAT_STANDALONE_NARROW_WEEKDAYS
The CLDR-style stand-alone "narrow" weekday names.
Definition: udat.h:1410
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:487
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_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:682
UDAT_SECOND_FIELD
@ UDAT_SECOND_FIELD
FieldPosition and UFieldPosition selector for 's' field alignment, corresponding to the UCAL_SECOND f...
Definition: udat.h:549
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:1376
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:1389
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
UCalendar
void * UCalendar
A calendar.
Definition: ucal.h:155
udat_toPatternRelativeTime
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.
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:1436
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:675
UDAT_PARSE_ALLOW_WHITESPACE
@ UDAT_PARSE_ALLOW_WHITESPACE
indicates whether whitespace is allowed.
Definition: udat.h:883
UDateFormatStyle
UDateFormatStyle
The possible date/time format styles.
Definition: udat.h:158
udat_toPatternRelativeDate
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_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:592
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:535
UDisplayContext
UDisplayContext
Display context settings.
Definition: udisplaycontext.h:64
UNumberFormat
void * UNumberFormat
A number formatter.
Definition: unum.h:141
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_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:1458
UCalendarDateFields
UCalendarDateFields
Possible fields in a UCalendar.
Definition: ucal.h:185
UDAT_SHORT_QUARTERS
@ UDAT_SHORT_QUARTERS
The short quarter names, for example Q1.
Definition: udat.h:1414
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
uint16_t UChar
Definition: umachine.h:353
UDAT_MEDIUM
@ UDAT_MEDIUM
Medium style.
Definition: udat.h:164
UDateFormatSymbolType
UDateFormatSymbolType
The possible types of date format symbols.
Definition: udat.h:1374
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:706
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:599
UDAT_WEEKDAYS
@ UDAT_WEEKDAYS
The CLDR-style format "wide" weekday names, for example Monday.
Definition: udat.h:1382
udat_applyPatternRelative
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_AM_PM_MIDNIGHT_NOON_FIELD
@ UDAT_AM_PM_MIDNIGHT_NOON_FIELD
FieldPosition selector for 'b' field alignment.
Definition: udat.h:772
udat_registerOpener
void udat_registerOpener(UDateFormatOpener opener, UErrorCode *status)
Register a provider factory.
U_NAMESPACE_END
#define U_NAMESPACE_END
Definition: uversion.h:138
U_CAPI
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition: umachine.h:109
UDAT_ERA_FIELD
@ UDAT_ERA_FIELD
FieldPosition and UFieldPosition selector for 'G' field alignment, corresponding to the UCAL_ERA fiel...
Definition: udat.h:496
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.
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
Definition: uversion.h:137
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:1464
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:606
UDAT_STANDALONE_MONTHS
@ UDAT_STANDALONE_MONTHS
Standalone context versions of months.
Definition: udat.h:1399
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:1447
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:166
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:510
UDAT_STANDALONE_QUARTERS
@ UDAT_STANDALONE_QUARTERS
Standalone context versions of quarters.
Definition: udat.h:1416
UDAT_SHORT_WEEKDAYS
@ UDAT_SHORT_WEEKDAYS
The CLDR-style format "abbreviated" (not "short") weekday names, for example "Mon....
Definition: udat.h:1387