ICU 64.2  64.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/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 
485 #ifndef U_HIDE_INTERNAL_API
486 
491 #define JP_ERA_2019_ROOT "Reiwa"
492 
497 #define JP_ERA_2019_JA "\\u4EE4\\u548C"
498 
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
779 
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
802 
809 #endif /* U_HIDE_INTERNAL_API */
810 
811 #ifndef U_HIDE_DEPRECATED_API
812 
819 #endif /* U_HIDE_DEPRECATED_API */
821 
822 
823 #ifndef U_HIDE_INTERNAL_API
824 
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
874 udat_open(UDateFormatStyle timeStyle,
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
891 udat_close(UDateFormat* format);
892 
893 
923 
924  /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
925  * it is needed for layout of DateFormat object. */
932 
943 U_CAPI UBool U_EXPORT2
945 
956 U_CAPI void U_EXPORT2
958 
959 
960 
961 #if U_SHOW_CPLUSPLUS_API
962 
964 
975 
977 
978 #endif
979 
988 U_CAPI UDateFormat* U_EXPORT2
989 udat_clone(const UDateFormat *fmt,
990  UErrorCode *status);
991 
1010 U_CAPI int32_t U_EXPORT2
1011 udat_format( const UDateFormat* format,
1012  UDate dateToFormat,
1013  UChar* result,
1014  int32_t resultLength,
1015  UFieldPosition* position,
1016  UErrorCode* status);
1017 
1040 U_CAPI int32_t U_EXPORT2
1041 udat_formatCalendar( const UDateFormat* format,
1042  UCalendar* calendar,
1043  UChar* result,
1044  int32_t capacity,
1045  UFieldPosition* position,
1046  UErrorCode* status);
1047 
1075 U_CAPI int32_t U_EXPORT2
1076 udat_formatForFields( const UDateFormat* format,
1077  UDate dateToFormat,
1078  UChar* result,
1079  int32_t resultLength,
1080  UFieldPositionIterator* fpositer,
1081  UErrorCode* status);
1082 
1113 U_CAPI int32_t U_EXPORT2
1115  UCalendar* calendar,
1116  UChar* result,
1117  int32_t capacity,
1118  UFieldPositionIterator* fpositer,
1119  UErrorCode* status);
1120 
1121 
1147 U_CAPI UDate U_EXPORT2
1148 udat_parse(const UDateFormat* format,
1149  const UChar* text,
1150  int32_t textLength,
1151  int32_t *parsePos,
1152  UErrorCode *status);
1153 
1175 U_CAPI void U_EXPORT2
1176 udat_parseCalendar(const UDateFormat* format,
1177  UCalendar* calendar,
1178  const UChar* text,
1179  int32_t textLength,
1180  int32_t *parsePos,
1181  UErrorCode *status);
1182 
1192 U_CAPI UBool U_EXPORT2
1193 udat_isLenient(const UDateFormat* fmt);
1194 
1204 U_CAPI void U_EXPORT2
1206  UBool isLenient);
1207 
1217 U_CAPI const UCalendar* U_EXPORT2
1218 udat_getCalendar(const UDateFormat* fmt);
1219 
1229 U_CAPI void U_EXPORT2
1231  const UCalendar* calendarToSet);
1232 
1242 U_CAPI const UNumberFormat* U_EXPORT2
1243 udat_getNumberFormat(const UDateFormat* fmt);
1244 
1254 U_CAPI const UNumberFormat* U_EXPORT2
1256 
1272 U_CAPI void U_EXPORT2
1274  const UChar* fields,
1275  UNumberFormat* numberFormatToSet,
1276  UErrorCode* status);
1289 U_CAPI void U_EXPORT2
1291  const UNumberFormat* numberFormatToSet);
1301 U_CAPI void U_EXPORT2
1303  UNumberFormat* numberFormatToAdopt);
1313 U_CAPI const char* U_EXPORT2
1314 udat_getAvailable(int32_t localeIndex);
1315 
1324 U_CAPI int32_t U_EXPORT2
1325 udat_countAvailable(void);
1326 
1337 U_CAPI UDate U_EXPORT2
1339  UErrorCode *status);
1340 
1351 U_CAPI void U_EXPORT2
1353  UDate d,
1354  UErrorCode *status);
1355 
1368 U_CAPI int32_t U_EXPORT2
1369 udat_toPattern( const UDateFormat *fmt,
1370  UBool localized,
1371  UChar *result,
1372  int32_t resultLength,
1373  UErrorCode *status);
1374 
1385 U_CAPI void U_EXPORT2
1387  UBool localized,
1388  const UChar *pattern,
1389  int32_t patternLength);
1390 
1421  UDAT_STANDALONE_SHORT_MONTHS,
1422  UDAT_STANDALONE_NARROW_MONTHS,
1438  UDAT_STANDALONE_SHORT_QUARTERS,
1487 
1488 struct UDateFormatSymbols;
1494 
1511 U_CAPI int32_t U_EXPORT2
1512 udat_getSymbols(const UDateFormat *fmt,
1513  UDateFormatSymbolType type,
1514  int32_t symbolIndex,
1515  UChar *result,
1516  int32_t resultLength,
1517  UErrorCode *status);
1518 
1531 U_CAPI int32_t U_EXPORT2
1532 udat_countSymbols( const UDateFormat *fmt,
1533  UDateFormatSymbolType type);
1534 
1550 U_CAPI void U_EXPORT2
1551 udat_setSymbols( UDateFormat *format,
1552  UDateFormatSymbolType type,
1553  int32_t symbolIndex,
1554  UChar *value,
1555  int32_t valueLength,
1556  UErrorCode *status);
1557 
1567 U_CAPI const char* U_EXPORT2
1569  ULocDataLocaleType type,
1570  UErrorCode* status);
1571 
1580 U_CAPI void U_EXPORT2
1582 
1592 U_CAPI UDisplayContext U_EXPORT2
1593 udat_getContext(const UDateFormat* fmt, UDisplayContextType type, UErrorCode* status);
1594 
1595 #ifndef U_HIDE_INTERNAL_API
1596 
1607 U_INTERNAL int32_t U_EXPORT2
1609  UChar *result,
1610  int32_t resultLength,
1611  UErrorCode *status);
1612 
1624 U_INTERNAL int32_t U_EXPORT2
1626  UChar *result,
1627  int32_t resultLength,
1628  UErrorCode *status);
1629 
1642 U_INTERNAL void U_EXPORT2
1644  const UChar *datePattern,
1645  int32_t datePatternLength,
1646  const UChar *timePattern,
1647  int32_t timePatternLength,
1648  UErrorCode *status);
1649 
1654 typedef UDateFormat* (U_EXPORT2 *UDateFormatOpener) (UDateFormatStyle timeStyle,
1655  UDateFormatStyle dateStyle,
1656  const char *locale,
1657  const UChar *tzID,
1658  int32_t tzIDLength,
1659  const UChar *pattern,
1660  int32_t patternLength,
1661  UErrorCode *status);
1662 
1667 U_INTERNAL void U_EXPORT2
1669 
1674 U_INTERNAL UDateFormatOpener U_EXPORT2
1676 #endif /* U_HIDE_INTERNAL_API */
1677 
1678 
1679 #endif /* #if !UCONFIG_NO_FORMATTING */
1680 
1681 #endif
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.
Definition: ucal.h:169
FieldPosition and UFieldPosition selector for &#39;w&#39; field alignment, corresponding to the UCAL_WEEK_OF_...
Definition: udat.h:613
FieldPosition selector for &#39;b&#39; field alignment.
Definition: udat.h:793
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.
FieldPosition and UFieldPosition selector for &#39;e&#39; field alignment, corresponding to the UCAL_DOW_LOCA...
Definition: udat.h:667
The CLDR-style short weekday names, e.g.
Definition: udat.h:1446
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.
Definition: udat.h:1420
UCalendarDateFields
Possible fields in a UCalendar.
Definition: ucal.h:199
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.
Definition: udat.h:916
The localized characters.
Definition: udat.h:1412
FieldPosition and UFieldPosition selector for &#39;V&#39; field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:743
The CLDR-style format "narrow" weekday names, for example "M".
Definition: udat.h:1418
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition: umachine.h:109
FieldPosition selector for "Q" field alignment, corresponding to quarters.
Definition: udat.h:727
C API: Calendar.
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 &#39;M&#39; field alignment, corresponding to the UCAL_MONTH fi...
Definition: udat.h:531
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 &#39;k&#39; field alignment, corresponding to the UCAL_HOUR_OF_...
Definition: udat.h:547
The long era names, for example Anno Domini.
Definition: udat.h:1414
void udat_applyPatternRelative(UDateFormat *format, const UChar *datePattern, int32_t datePatternLength, const UChar *timePattern, int32_t timePatternLength, UErrorCode *status)
Set the date & time patterns used by a UDateFormat set for relative date formatting.
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols ...
Definition: udat.h:1485
Short style.
Definition: udat.h:166
The quarters, for example 1st Quarter.
Definition: udat.h:1433
void udat_registerOpener(UDateFormatOpener opener, UErrorCode *status)
Register a provider factory.
UDisplayContext
Display context settings.
double UDate
Date and Time data type.
Definition: utypes.h:203
No style.
Definition: udat.h:183
The CLDR-style stand-alone "wide" weekday names.
Definition: udat.h:1424
Long style.
Definition: udat.h:162
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 &#39;X&#39; field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
Definition: udat.h:768
struct UFieldPositionIterator UFieldPositionIterator
C typedef for struct UFieldPositionIterator.
Definition: ufieldpositer.h:44
The short month names, for example Feb.
Definition: udat.h:1401
#define U_INTERNAL
This is used to declare a function as an internal ICU C API.
Definition: umachine.h:119
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.
Definition: udat.h:190
Default style.
Definition: udat.h:168
One more than the highest normal UDateFormatBooleanAttribute value.
Definition: udat.h:930
#define U_HIDE_INTERNAL_API
Define this to 1 to request that internal API be "hidden".
Definition: utypes.h:87
C API: Display context types (enum values)
FieldPosition and UFieldPosition selector for &#39;g&#39; field alignment, corresponding to the UCAL_JULIAN_D...
Definition: udat.h:681
indicates tolerance of numeric data when String data may be assumed.
Definition: udat.h:910
Bitfield for relative date.
Definition: udat.h:171
FieldPosition and UFieldPosition selector for &#39;D&#39; field alignment, corresponding to the UCAL_DAY_OF_Y...
Definition: udat.h:599
FieldPosition selector for the "q" field alignment, corresponding to stand-alone quarters.
Definition: udat.h:736
FieldPosition and UFieldPosition selector for &#39;u&#39; field alignment, corresponding to the UCAL_EXTENDED...
Definition: udat.h:674
FieldPosition and UFieldPosition selector for &#39;r&#39; field alignment, no directly corresponding UCAL_ fi...
Definition: udat.h:784
FieldPosition selector for &#39;c&#39; field alignment, corresponding to the UCAL_DOW_LOCAL field...
Definition: udat.h:710
FieldPosition and UFieldPosition selector for &#39;d&#39; field alignment, corresponding to the UCAL_DATE fie...
Definition: udat.h:538
indicates tolerance of pattern mismatch between input data and specified format pattern.
Definition: udat.h:922
Full style.
Definition: udat.h:160
FieldPosition and UFieldPosition selector for time separator, no corresponding UCAL_ field...
Definition: udat.h:808
FieldPosition and UFieldPosition selector for &#39;Y&#39; field alignment, corresponding to the UCAL_YEAR_WOY...
Definition: udat.h:660
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:137
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:1654
FieldPosition and UFieldPosition selector for &#39;F&#39; field alignment, corresponding to the UCAL_DAY_OF_W...
Definition: udat.h:606
UDateFormatSymbolType
The possible types of date format symbols.
Definition: udat.h:1395
The CLDR-style stand-alone "narrow" weekday names.
Definition: udat.h:1431
U_CAPI void udat_setNumberFormat(UDateFormat *fmt, const UNumberFormat *numberFormatToSet)
Set the UNumberFormat associated with an UDateFormat.
The month names, for example February.
Definition: udat.h:1399
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:562
void * UNumberFormat
A number formatter.
Definition: unum.h:141
A struct representing a range of text containing a specific field.
Definition: umisc.h:34
FieldPosition selector for &#39;O&#39; field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
Definition: udat.h:760
FieldPosition and UFieldPosition selector for &#39;A&#39; field alignment, corresponding to the UCAL_MILLISEC...
Definition: udat.h:688
indicates whether whitespace is allowed.
Definition: udat.h:904
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.
void * UDateFormat
A date formatter.
Definition: udat.h:153
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_toPattern(const UDateFormat *fmt, UBool localized, UChar *result, int32_t resultLength, UErrorCode *status)
Extract the pattern from a UDateFormat.
FieldPosition and UFieldPosition selector for &#39;v&#39; field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:703
U_CAPI UBool udat_isLenient(const UDateFormat *fmt)
Determine if an UDateFormat will perform lenient parsing.
The era names, for example AD.
Definition: udat.h:1397
Cyclic year names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols not ...
Definition: udat.h:1457
FieldPosition and UFieldPosition selector for &#39;W&#39; field alignment, corresponding to the UCAL_WEEK_OF_...
Definition: udat.h:620
The CLDR-style format "wide" weekday names, for example Monday.
Definition: udat.h:1403
struct UDateFormatSymbols UDateFormatSymbols
Date format symbols.
Definition: udat.h:1493
UDateFormatStyle
The possible date/time format styles.
Definition: udat.h:158
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols ...
Definition: udat.h:1474
FieldPosition and UFieldPosition selector for &#39;E&#39; field alignment, corresponding to the UCAL_DAY_OF_W...
Definition: udat.h:592
FieldPosition and UFieldPosition selector for &#39;a&#39; field alignment, corresponding to the UCAL_AM_PM fi...
Definition: udat.h:627
"Smart pointer" class, closes a UDateFormat via udat_close().
The short quarter names, for example Q1.
Definition: udat.h:1435
Cyclic year names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols not ...
Definition: udat.h:1468
FieldPosition and UFieldPosition selector for &#39;K&#39; field alignment, corresponding to the UCAL_HOUR fie...
Definition: udat.h:645
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.
uint16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:342
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.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:138
UDisplayContextType
Display context types, for getting values of a particular setting.
Standalone context versions of quarters.
Definition: udat.h:1437
UDateFormatField
FieldPosition and UFieldPosition selectors for format fields defined by DateFormat and UDateFormat...
Definition: udat.h:511
FieldPosition and UFieldPosition selector for &#39;G&#39; field alignment, corresponding to the UCAL_ERA fiel...
Definition: udat.h:517
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
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:401
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested...
Definition: uloc.h:338
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 &#39;m&#39; field alignment, corresponding to the UCAL_MINUTE f...
Definition: udat.h:563
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.
Definition: udat.h:1429
The narrow month names, for example F.
Definition: udat.h:1416
Cyclic year names (only supported for some calendars, and only for FORMAT usage)
Definition: udat.h:1462
U_CAPI UDisplayContext udat_getContext(const UDateFormat *fmt, UDisplayContextType type, UErrorCode *status)
Get the formatter&#39;s UDisplayContext value for the specified UDisplayContextType, such as UDISPCTX_TYP...
FieldPosition selector for &#39;x&#39; field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
Definition: udat.h:776
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 &#39;s&#39; field alignment, corresponding to the UCAL_SECOND f...
Definition: udat.h:570
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.
Definition: udat.h:1408
U_CAPI void udat_close(UDateFormat *format)
Close a UDateFormat.
FieldPosition and UFieldPosition selector for &#39;z&#39; field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:653
FieldPosition and UFieldPosition selector for &#39;y&#39; field alignment, corresponding to the UCAL_YEAR fie...
Definition: udat.h:524
FieldPosition selector for &#39;L&#39; field alignment, corresponding to the UCAL_MONTH field.
Definition: udat.h:718
The AM/PM names, for example AM.
Definition: udat.h:1410
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.
Definition: udat.h:818
int32_t udat_toPatternRelativeTime(const UDateFormat *fmt, UChar *result, int32_t resultLength, UErrorCode *status)
Extract the time pattern from a UDateFormat set for relative date formatting.
FieldPosition and UFieldPosition selector for &#39;Z&#39; field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:696
FieldPosition and UFieldPosition selector for &#39;H&#39; field alignment, corresponding to the UCAL_HOUR_OF_...
Definition: udat.h:556
U_CAPI UBool udat_getBooleanAttribute(const UDateFormat *fmt, UDateFormatBooleanAttribute attr, UErrorCode *status)
Get a boolean attribute associated with a UDateFormat.
UDateFormatBooleanAttribute
DateFormat boolean attributes.
Definition: udat.h:899
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 &#39;S&#39; field alignment, corresponding to the UCAL_MILLISEC...
Definition: udat.h:585
FieldPosition and UFieldPosition selector for &#39;h&#39; field alignment, corresponding to the UCAL_HOUR fie...
Definition: udat.h:636
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage) ...
Definition: udat.h:1479
UDateFormatOpener udat_unregisterOpener(UDateFormatOpener opener, UErrorCode *status)
Un-Register a provider factory.
FieldPosition selector for "U" field alignment, corresponding to cyclic year names.
Definition: udat.h:752
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.
Definition: umachine.h:225
C API: Compatibility APIs for number formatting.
Medium style.
Definition: udat.h:164
U_CAPI void udat_setCalendar(UDateFormat *fmt, const UCalendar *calendarToSet)
Set the UCalendar associated with an UDateFormat.
Standalone version of UDAT_SHORTER_WEEKDAYS.
Definition: udat.h:1451