ICU 69.1  69.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/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 
983 typedef enum UDateFormatHourCycle {
989 
995 
1001 
1008 
1009 #if U_SHOW_CPLUSPLUS_API
1010 
1011 U_NAMESPACE_BEGIN
1012 
1023 
1024 U_NAMESPACE_END
1025 
1026 #endif
1027 
1036 U_CAPI UDateFormat* U_EXPORT2
1037 udat_clone(const UDateFormat *fmt,
1038  UErrorCode *status);
1039 
1058 U_CAPI int32_t U_EXPORT2
1059 udat_format( const UDateFormat* format,
1060  UDate dateToFormat,
1061  UChar* result,
1062  int32_t resultLength,
1063  UFieldPosition* position,
1064  UErrorCode* status);
1065 
1088 U_CAPI int32_t U_EXPORT2
1089 udat_formatCalendar( const UDateFormat* format,
1090  UCalendar* calendar,
1091  UChar* result,
1092  int32_t capacity,
1093  UFieldPosition* position,
1094  UErrorCode* status);
1095 
1123 U_CAPI int32_t U_EXPORT2
1124 udat_formatForFields( const UDateFormat* format,
1125  UDate dateToFormat,
1126  UChar* result,
1127  int32_t resultLength,
1128  UFieldPositionIterator* fpositer,
1129  UErrorCode* status);
1130 
1161 U_CAPI int32_t U_EXPORT2
1163  UCalendar* calendar,
1164  UChar* result,
1165  int32_t capacity,
1166  UFieldPositionIterator* fpositer,
1167  UErrorCode* status);
1168 
1169 
1195 U_CAPI UDate U_EXPORT2
1196 udat_parse(const UDateFormat* format,
1197  const UChar* text,
1198  int32_t textLength,
1199  int32_t *parsePos,
1200  UErrorCode *status);
1201 
1223 U_CAPI void U_EXPORT2
1224 udat_parseCalendar(const UDateFormat* format,
1225  UCalendar* calendar,
1226  const UChar* text,
1227  int32_t textLength,
1228  int32_t *parsePos,
1229  UErrorCode *status);
1230 
1240 U_CAPI UBool U_EXPORT2
1241 udat_isLenient(const UDateFormat* fmt);
1242 
1252 U_CAPI void U_EXPORT2
1254  UBool isLenient);
1255 
1265 U_CAPI const UCalendar* U_EXPORT2
1266 udat_getCalendar(const UDateFormat* fmt);
1267 
1277 U_CAPI void U_EXPORT2
1279  const UCalendar* calendarToSet);
1280 
1290 U_CAPI const UNumberFormat* U_EXPORT2
1291 udat_getNumberFormat(const UDateFormat* fmt);
1292 
1302 U_CAPI const UNumberFormat* U_EXPORT2
1304 
1320 U_CAPI void U_EXPORT2
1322  const UChar* fields,
1323  UNumberFormat* numberFormatToSet,
1324  UErrorCode* status);
1337 U_CAPI void U_EXPORT2
1339  const UNumberFormat* numberFormatToSet);
1349 U_CAPI void U_EXPORT2
1351  UNumberFormat* numberFormatToAdopt);
1361 U_CAPI const char* U_EXPORT2
1362 udat_getAvailable(int32_t localeIndex);
1363 
1372 U_CAPI int32_t U_EXPORT2
1373 udat_countAvailable(void);
1374 
1385 U_CAPI UDate U_EXPORT2
1387  UErrorCode *status);
1388 
1399 U_CAPI void U_EXPORT2
1401  UDate d,
1402  UErrorCode *status);
1403 
1416 U_CAPI int32_t U_EXPORT2
1417 udat_toPattern( const UDateFormat *fmt,
1418  UBool localized,
1419  UChar *result,
1420  int32_t resultLength,
1421  UErrorCode *status);
1422 
1433 U_CAPI void U_EXPORT2
1435  UBool localized,
1436  const UChar *pattern,
1437  int32_t patternLength);
1438 
1469  UDAT_STANDALONE_SHORT_MONTHS,
1470  UDAT_STANDALONE_NARROW_MONTHS,
1486  UDAT_STANDALONE_SHORT_QUARTERS,
1535 
1536 struct UDateFormatSymbols;
1542 
1559 U_CAPI int32_t U_EXPORT2
1560 udat_getSymbols(const UDateFormat *fmt,
1561  UDateFormatSymbolType type,
1562  int32_t symbolIndex,
1563  UChar *result,
1564  int32_t resultLength,
1565  UErrorCode *status);
1566 
1579 U_CAPI int32_t U_EXPORT2
1580 udat_countSymbols( const UDateFormat *fmt,
1581  UDateFormatSymbolType type);
1582 
1598 U_CAPI void U_EXPORT2
1599 udat_setSymbols( UDateFormat *format,
1600  UDateFormatSymbolType type,
1601  int32_t symbolIndex,
1602  UChar *value,
1603  int32_t valueLength,
1604  UErrorCode *status);
1605 
1615 U_CAPI const char* U_EXPORT2
1617  ULocDataLocaleType type,
1618  UErrorCode* status);
1619 
1628 U_CAPI void U_EXPORT2
1630 
1640 U_CAPI UDisplayContext U_EXPORT2
1641 udat_getContext(const UDateFormat* fmt, UDisplayContextType type, UErrorCode* status);
1642 
1643 #ifndef U_HIDE_INTERNAL_API
1644 
1655 U_CAPI int32_t U_EXPORT2
1657  UChar *result,
1658  int32_t resultLength,
1659  UErrorCode *status);
1660 
1672 U_CAPI int32_t U_EXPORT2
1674  UChar *result,
1675  int32_t resultLength,
1676  UErrorCode *status);
1677 
1690 U_CAPI void U_EXPORT2
1692  const UChar *datePattern,
1693  int32_t datePatternLength,
1694  const UChar *timePattern,
1695  int32_t timePatternLength,
1696  UErrorCode *status);
1697 
1702 typedef UDateFormat* (U_EXPORT2 *UDateFormatOpener) (UDateFormatStyle timeStyle,
1703  UDateFormatStyle dateStyle,
1704  const char *locale,
1705  const UChar *tzID,
1706  int32_t tzIDLength,
1707  const UChar *pattern,
1708  int32_t patternLength,
1709  UErrorCode *status);
1710 
1715 U_CAPI void U_EXPORT2
1717 
1722 U_CAPI UDateFormatOpener U_EXPORT2
1724 #endif /* U_HIDE_INTERNAL_API */
1725 
1726 
1727 #endif /* #if !UCONFIG_NO_FORMATTING */
1728 
1729 #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:172
FieldPosition and UFieldPosition selector for &#39;w&#39; field alignment, corresponding to the UCAL_WEEK_OF_...
Definition: udat.h:617
FieldPosition selector for &#39;b&#39; field alignment.
Definition: udat.h:797
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.
Hour in day (1~24)
Definition: udat.h:1006
U_CAPI int32_t udat_toPatternRelativeDate(const UDateFormat *fmt, UChar *result, int32_t resultLength, UErrorCode *status)
Extract the date pattern from a UDateFormat set for relative date formatting.
FieldPosition and UFieldPosition selector for &#39;e&#39; field alignment, corresponding to the UCAL_DOW_LOCA...
Definition: udat.h:671
The CLDR-style short weekday names, e.g.
Definition: udat.h:1494
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:1468
UCalendarDateFields
Possible fields in a UCalendar.
Definition: ucal.h:202
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:934
The localized characters.
Definition: udat.h:1460
FieldPosition and UFieldPosition selector for &#39;V&#39; field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:747
The CLDR-style format &quot;narrow&quot; weekday names, for example &quot;M&quot;.
Definition: udat.h:1466
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition: umachine.h:110
FieldPosition selector for &quot;Q&quot; field alignment, corresponding to quarters.
Definition: udat.h:731
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:535
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:551
The long era names, for example Anno Domini.
Definition: udat.h:1462
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols ...
Definition: udat.h:1533
Short style.
Definition: udat.h:170
The quarters, for example 1st Quarter.
Definition: udat.h:1481
UDisplayContext
Display context settings.
double UDate
Date and Time data type.
Definition: utypes.h:203
No style.
Definition: udat.h:187
The CLDR-style stand-alone &quot;wide&quot; weekday names.
Definition: udat.h:1472
Long style.
Definition: udat.h:166
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:772
UDateFormatHourCycle
Hour Cycle.
Definition: udat.h:983
struct UFieldPositionIterator UFieldPositionIterator
C typedef for struct UFieldPositionIterator.
Definition: ufieldpositer.h:46
The short month names, for example Feb.
Definition: udat.h:1449
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:194
U_CAPI UDateFormatOpener udat_unregisterOpener(UDateFormatOpener opener, UErrorCode *status)
Un-Register a provider factory.
Default style.
Definition: udat.h:172
One more than the highest normal UDateFormatBooleanAttribute value.
Definition: udat.h:949
#define U_HIDE_INTERNAL_API
Define this to 1 to request that internal API be &quot;hidden&quot;.
Definition: utypes.h:87
U_CAPI void udat_registerOpener(UDateFormatOpener opener, UErrorCode *status)
Register a provider factory.
C API: Display context types (enum values)
FieldPosition and UFieldPosition selector for &#39;g&#39; field alignment, corresponding to the UCAL_JULIAN_D...
Definition: udat.h:685
indicates tolerance of numeric data when String data may be assumed.
Definition: udat.h:928
Bitfield for relative date.
Definition: udat.h:175
FieldPosition and UFieldPosition selector for &#39;D&#39; field alignment, corresponding to the UCAL_DAY_OF_Y...
Definition: udat.h:603
FieldPosition selector for the &quot;q&quot; field alignment, corresponding to stand-alone quarters.
Definition: udat.h:740
FieldPosition and UFieldPosition selector for &#39;u&#39; field alignment, corresponding to the UCAL_EXTENDED...
Definition: udat.h:678
FieldPosition and UFieldPosition selector for &#39;r&#39; field alignment, no directly corresponding UCAL_ fi...
Definition: udat.h:788
Hour in am/pm (1~12)
Definition: udat.h:994
FieldPosition selector for &#39;c&#39; field alignment, corresponding to the UCAL_DOW_LOCAL field...
Definition: udat.h:714
FieldPosition and UFieldPosition selector for &#39;d&#39; field alignment, corresponding to the UCAL_DATE fie...
Definition: udat.h:542
indicates tolerance of pattern mismatch between input data and specified format pattern.
Definition: udat.h:940
Full style.
Definition: udat.h:164
FieldPosition and UFieldPosition selector for time separator, no corresponding UCAL_ field...
Definition: udat.h:812
FieldPosition and UFieldPosition selector for &#39;Y&#39; field alignment, corresponding to the UCAL_YEAR_WOY...
Definition: udat.h:664
FieldPosition and UFieldPosition selector for &#39;F&#39; field alignment, corresponding to the UCAL_DAY_OF_W...
Definition: udat.h:610
UDateFormatSymbolType
The possible types of date format symbols.
Definition: udat.h:1443
The CLDR-style stand-alone &quot;narrow&quot; weekday names.
Definition: udat.h:1479
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:1447
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
&quot;Smart pointer&quot; definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:550
void * UNumberFormat
A number formatter.
Definition: unum.h:144
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:764
FieldPosition and UFieldPosition selector for &#39;A&#39; field alignment, corresponding to the UCAL_MILLISEC...
Definition: udat.h:692
indicates whether whitespace is allowed.
Definition: udat.h:922
U_CAPI UCalendarDateFields udat_toCalendarDateField(UDateFormatField field)
Maps from a UDateFormatField to the corresponding UCalendarDateFields.
C++ API: &quot;Smart pointers&quot; for use with and in ICU4C C++ code.
U_CAPI void udat_adoptNumberFormat(UDateFormat *fmt, UNumberFormat *numberFormatToAdopt)
Adopt the UNumberFormat associated with an UDateFormat.
U_CAPI const char * udat_getAvailable(int32_t localeIndex)
Get a locale for which date/time formatting patterns are available.
U_CAPI int32_t udat_toPatternRelativeTime(const UDateFormat *fmt, UChar *result, int32_t resultLength, UErrorCode *status)
Extract the time pattern from a UDateFormat set for relative date formatting.
void * UDateFormat
A date formatter.
Definition: udat.h:157
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:707
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:1445
Cyclic year names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols not ...
Definition: udat.h:1505
U_CAPI void udat_applyPatternRelative(UDateFormat *format, const UChar *datePattern, int32_t datePatternLength, const UChar *timePattern, int32_t timePatternLength, UErrorCode *status)
Set the date &amp; time patterns used by a UDateFormat set for relative date formatting.
FieldPosition and UFieldPosition selector for &#39;W&#39; field alignment, corresponding to the UCAL_WEEK_OF_...
Definition: udat.h:624
The CLDR-style format &quot;wide&quot; weekday names, for example Monday.
Definition: udat.h:1451
struct UDateFormatSymbols UDateFormatSymbols
Date format symbols.
Definition: udat.h:1541
UDateFormatStyle
The possible date/time format styles.
Definition: udat.h:162
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols ...
Definition: udat.h:1522
FieldPosition and UFieldPosition selector for &#39;E&#39; field alignment, corresponding to the UCAL_DAY_OF_W...
Definition: udat.h:596
FieldPosition and UFieldPosition selector for &#39;a&#39; field alignment, corresponding to the UCAL_AM_PM fi...
Definition: udat.h:631
&quot;Smart pointer&quot; class, closes a UDateFormat via udat_close().
The short quarter names, for example Q1.
Definition: udat.h:1483
Cyclic year names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols not ...
Definition: udat.h:1516
FieldPosition and UFieldPosition selector for &#39;K&#39; field alignment, corresponding to the UCAL_HOUR fie...
Definition: udat.h:649
U_CAPI void udat_setSymbols(UDateFormat *format, UDateFormatSymbolType type, int32_t symbolIndex, UChar *value, int32_t valueLength, UErrorCode *status)
Set the symbols associated with an UDateFormat.
char16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:418
U_CAPI void udat_setLenient(UDateFormat *fmt, UBool isLenient)
Specify whether an UDateFormat will perform lenient parsing.
U_CAPI UDate udat_get2DigitYearStart(const UDateFormat *fmt, UErrorCode *status)
Get the year relative to which all 2-digit years are interpreted.
UDisplayContextType
Display context types, for getting values of a particular setting.
Standalone context versions of quarters.
Definition: udat.h:1485
UDateFormatField
FieldPosition and UFieldPosition selectors for format fields defined by DateFormat and UDateFormat...
Definition: udat.h:515
FieldPosition and UFieldPosition selector for &#39;G&#39; field alignment, corresponding to the UCAL_ERA fiel...
Definition: udat.h:521
U_CAPI void udat_parseCalendar(const UDateFormat *format, UCalendar *calendar, const UChar *text, int32_t textLength, int32_t *parsePos, UErrorCode *status)
Parse a string into an date/time using a UDateFormat.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
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:567
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 &quot;abbreviated&quot; (not &quot;short&quot;) weekday names.
Definition: udat.h:1477
The narrow month names, for example F.
Definition: udat.h:1464
Cyclic year names (only supported for some calendars, and only for FORMAT usage)
Definition: udat.h:1510
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:780
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:574
Basic definitions for ICU, for both C and C++ APIs.
The CLDR-style format &quot;abbreviated&quot; (not &quot;short&quot;) weekday names, for example &quot;Mon.&quot; For the CLDR-style format &quot;short&quot; weekday names, use UDAT_SHORTER_WEEKDAYS.
Definition: udat.h:1456
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:657
FieldPosition and UFieldPosition selector for &#39;y&#39; field alignment, corresponding to the UCAL_YEAR fie...
Definition: udat.h:528
FieldPosition selector for &#39;L&#39; field alignment, corresponding to the UCAL_MONTH field.
Definition: udat.h:722
The AM/PM names, for example AM.
Definition: udat.h:1458
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:822
FieldPosition and UFieldPosition selector for &#39;Z&#39; field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:700
Hour in day (0~23)
Definition: udat.h:1000
FieldPosition and UFieldPosition selector for &#39;H&#39; field alignment, corresponding to the UCAL_HOUR_OF_...
Definition: udat.h:560
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:917
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:589
FieldPosition and UFieldPosition selector for &#39;h&#39; field alignment, corresponding to the UCAL_HOUR fie...
Definition: udat.h:640
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage) ...
Definition: udat.h:1527
Hour in am/pm (0~11)
Definition: udat.h:988
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:1702
FieldPosition selector for &quot;U&quot; field alignment, corresponding to cyclic year names.
Definition: udat.h:756
U_CAPI void udat_setBooleanAttribute(UDateFormat *fmt, UDateFormatBooleanAttribute attr, UBool newValue, UErrorCode *status)
Set a boolean attribute associated with a UDateFormat.
U_CAPI void udat_set2DigitYearStart(UDateFormat *fmt, UDate d, UErrorCode *status)
Set the year relative to which all 2-digit years will be interpreted.
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition: umachine.h:269
C API: Compatibility APIs for number formatting.
Medium style.
Definition: udat.h:168
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:1499