ICU 58.2 58.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

udat.h
Go to the documentation of this file.
1 // Copyright (C) 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"
20 #include "unicode/udisplaycontext.h"
21 #include "unicode/ufieldpositer.h"
153 typedef void* UDateFormat;
154
158 typedef enum UDateFormatStyle {
160 UDAT_FULL,
162 UDAT_LONG,
164 UDAT_MEDIUM,
166 UDAT_SHORT,
168 UDAT_DEFAULT = UDAT_MEDIUM,
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
190 UDAT_PATTERN = -2,
191
192 #ifndef U_HIDE_INTERNAL_API
194 UDAT_IGNORE = UDAT_PATTERN
195 #endif /* U_HIDE_INTERNAL_API */
196 } UDateFormatStyle;
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 {
496 UDAT_ERA_FIELD = 0,
497
503 UDAT_YEAR_FIELD = 1,
504
510 UDAT_MONTH_FIELD = 2,
511
517 UDAT_DATE_FIELD = 3,
518
526 UDAT_HOUR_OF_DAY1_FIELD = 4,
527
535 UDAT_HOUR_OF_DAY0_FIELD = 5,
536
542 UDAT_MINUTE_FIELD = 6,
543
549 UDAT_SECOND_FIELD = 7,
550
564 UDAT_FRACTIONAL_SECOND_FIELD = 8,
565
571 UDAT_DAY_OF_WEEK_FIELD = 9,
572
578 UDAT_DAY_OF_YEAR_FIELD = 10,
579
585 UDAT_DAY_OF_WEEK_IN_MONTH_FIELD = 11,
586
592 UDAT_WEEK_OF_YEAR_FIELD = 12,
593
599 UDAT_WEEK_OF_MONTH_FIELD = 13,
600
606 UDAT_AM_PM_FIELD = 14,
607
615 UDAT_HOUR1_FIELD = 15,
616
624 UDAT_HOUR0_FIELD = 16,
625
632 UDAT_TIMEZONE_FIELD = 17,
633
639 UDAT_YEAR_WOY_FIELD = 18,
640
646 UDAT_DOW_LOCAL_FIELD = 19,
647
653 UDAT_EXTENDED_YEAR_FIELD = 20,
654
660 UDAT_JULIAN_DAY_FIELD = 21,
661
667 UDAT_MILLISECONDS_IN_DAY_FIELD = 22,
668
675 UDAT_TIMEZONE_RFC_FIELD = 23,
676
682 UDAT_TIMEZONE_GENERIC_FIELD = 24,
689 UDAT_STANDALONE_DAY_FIELD = 25,
690
697 UDAT_STANDALONE_MONTH_FIELD = 26,
698
706 UDAT_QUARTER_FIELD = 27,
707
715 UDAT_STANDALONE_QUARTER_FIELD = 28,
716
722 UDAT_TIMEZONE_SPECIAL_FIELD = 29,
723
731 UDAT_YEAR_NAME_FIELD = 30,
732
739 UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31,
740
747 UDAT_TIMEZONE_ISO_FIELD = 32,
748
755 UDAT_TIMEZONE_ISO_LOCAL_FIELD = 33,
756
757 #ifndef U_HIDE_INTERNAL_API
758
763 UDAT_RELATED_YEAR_FIELD = 34,
764 #endif /* U_HIDE_INTERNAL_API */
765
766 #ifndef U_HIDE_DRAFT_API
767
773 UDAT_AM_PM_MIDNIGHT_NOON_FIELD = 35,
774
775 /* FieldPosition selector for 'B' field alignment.
776 * Displays flexible day periods, such as "in the morning", if available.
777 * @draft ICU 57
778 */
779 UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36,
780 #endif /* U_HIDE_DRAFT_API */
781
782 #ifndef U_HIDE_INTERNAL_API
783
789 UDAT_TIME_SEPARATOR_FIELD = 37,
790 #endif /* U_HIDE_INTERNAL_API */
791
792 #ifndef U_HIDE_DEPRECATED_API
793
799 UDAT_FIELD_COUNT = 38
800 #endif // U_HIDE_DEPRECATED_API
801 } UDateFormatField;
802
803
804 #ifndef U_HIDE_INTERNAL_API
805
810 #define UDAT_HAS_PATTERN_CHAR_FOR_TIME_SEPARATOR 0
811 #endif /* U_HIDE_INTERNAL_API */
812
813
822 U_STABLE UCalendarDateFields U_EXPORT2
823 udat_toCalendarDateField(UDateFormatField field);
824
825
854 U_STABLE UDateFormat* U_EXPORT2
855 udat_open(UDateFormatStyle timeStyle,
856 UDateFormatStyle dateStyle,
857 const char *locale,
858 const UChar *tzID,
859 int32_t tzIDLength,
860 const UChar *pattern,
861 int32_t patternLength,
862 UErrorCode *status);
863
864
871 U_STABLE void U_EXPORT2
872 udat_close(UDateFormat* format);
873
874
880 typedef enum UDateFormatBooleanAttribute {
885 UDAT_PARSE_ALLOW_WHITESPACE = 0,
891 UDAT_PARSE_ALLOW_NUMERIC = 1,
897 UDAT_PARSE_PARTIAL_LITERAL_MATCH = 2,
903 UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH = 3,
904
905 // Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
906 // it is needed for layout of DateFormat object.
911 UDAT_BOOLEAN_ATTRIBUTE_COUNT = 4
912 } UDateFormatBooleanAttribute;
913
924 U_STABLE UBool U_EXPORT2
925 udat_getBooleanAttribute(const UDateFormat* fmt, UDateFormatBooleanAttribute attr, UErrorCode* status);
926
937 U_STABLE void U_EXPORT2
938 udat_setBooleanAttribute(UDateFormat *fmt, UDateFormatBooleanAttribute attr, UBool newValue, UErrorCode* status);
939
940
941
942 #if U_SHOW_CPLUSPLUS_API
943
944 U_NAMESPACE_BEGIN
945
955 U_DEFINE_LOCAL_OPEN_POINTER(LocalUDateFormatPointer, UDateFormat, udat_close);
956
957 U_NAMESPACE_END
958
959 #endif
960
969 U_STABLE UDateFormat* U_EXPORT2
970 udat_clone(const UDateFormat *fmt,
971 UErrorCode *status);
972
991 U_STABLE int32_t U_EXPORT2
992 udat_format( const UDateFormat* format,
993 UDate dateToFormat,
994 UChar* result,
995 int32_t resultLength,
996 UFieldPosition* position,
997 UErrorCode* status);
998
1021 U_STABLE int32_t U_EXPORT2
1022 udat_formatCalendar( const UDateFormat* format,
1023 UCalendar* calendar,
1024 UChar* result,
1025 int32_t capacity,
1026 UFieldPosition* position,
1027 UErrorCode* status);
1028
1056 U_STABLE int32_t U_EXPORT2
1057 udat_formatForFields( const UDateFormat* format,
1058 UDate dateToFormat,
1059 UChar* result,
1060 int32_t resultLength,
1061 UFieldPositionIterator* fpositer,
1062 UErrorCode* status);
1063
1094 U_STABLE int32_t U_EXPORT2
1095 udat_formatCalendarForFields( const UDateFormat* format,
1096 UCalendar* calendar,
1097 UChar* result,
1098 int32_t capacity,
1099 UFieldPositionIterator* fpositer,
1100 UErrorCode* status);
1101
1102
1128 U_STABLE UDate U_EXPORT2
1129 udat_parse(const UDateFormat* format,
1130 const UChar* text,
1131 int32_t textLength,
1132 int32_t *parsePos,
1133 UErrorCode *status);
1134
1156 U_STABLE void U_EXPORT2
1157 udat_parseCalendar(const UDateFormat* format,
1158 UCalendar* calendar,
1159 const UChar* text,
1160 int32_t textLength,
1161 int32_t *parsePos,
1162 UErrorCode *status);
1163
1173 U_STABLE UBool U_EXPORT2
1174 udat_isLenient(const UDateFormat* fmt);
1175
1185 U_STABLE void U_EXPORT2
1186 udat_setLenient( UDateFormat* fmt,
1187 UBool isLenient);
1188
1198 U_STABLE const UCalendar* U_EXPORT2
1199 udat_getCalendar(const UDateFormat* fmt);
1200
1210 U_STABLE void U_EXPORT2
1211 udat_setCalendar( UDateFormat* fmt,
1212 const UCalendar* calendarToSet);
1213
1223 U_STABLE const UNumberFormat* U_EXPORT2
1224 udat_getNumberFormat(const UDateFormat* fmt);
1225
1235 U_STABLE const UNumberFormat* U_EXPORT2
1236 udat_getNumberFormatForField(const UDateFormat* fmt, UChar field);
1237
1253 U_STABLE void U_EXPORT2
1254 udat_adoptNumberFormatForFields( UDateFormat* fmt,
1255 const UChar* fields,
1256 UNumberFormat* numberFormatToSet,
1257 UErrorCode* status);
1270 U_STABLE void U_EXPORT2
1271 udat_setNumberFormat( UDateFormat* fmt,
1272 const UNumberFormat* numberFormatToSet);
1282 U_STABLE void U_EXPORT2
1283 udat_adoptNumberFormat( UDateFormat* fmt,
1284 UNumberFormat* numberFormatToAdopt);
1294 U_STABLE const char* U_EXPORT2
1295 udat_getAvailable(int32_t localeIndex);
1296
1305 U_STABLE int32_t U_EXPORT2
1306 udat_countAvailable(void);
1307
1318 U_STABLE UDate U_EXPORT2
1319 udat_get2DigitYearStart( const UDateFormat *fmt,
1320 UErrorCode *status);
1321
1332 U_STABLE void U_EXPORT2
1333 udat_set2DigitYearStart( UDateFormat *fmt,
1334 UDate d,
1335 UErrorCode *status);
1336
1349 U_STABLE int32_t U_EXPORT2
1350 udat_toPattern( const UDateFormat *fmt,
1351 UBool localized,
1352 UChar *result,
1353 int32_t resultLength,
1354 UErrorCode *status);
1355
1366 U_STABLE void U_EXPORT2
1367 udat_applyPattern( UDateFormat *format,
1368 UBool localized,
1369 const UChar *pattern,
1370 int32_t patternLength);
1371
1376 typedef enum UDateFormatSymbolType {
1378 UDAT_ERAS,
1380 UDAT_MONTHS,
1382 UDAT_SHORT_MONTHS,
1384 UDAT_WEEKDAYS,
1389 UDAT_SHORT_WEEKDAYS,
1391 UDAT_AM_PMS,
1393 UDAT_LOCALIZED_CHARS,
1395 UDAT_ERA_NAMES,
1397 UDAT_NARROW_MONTHS,
1399 UDAT_NARROW_WEEKDAYS,
1401 UDAT_STANDALONE_MONTHS,
1402 UDAT_STANDALONE_SHORT_MONTHS,
1403 UDAT_STANDALONE_NARROW_MONTHS,
1405 UDAT_STANDALONE_WEEKDAYS,
1410 UDAT_STANDALONE_SHORT_WEEKDAYS,
1412 UDAT_STANDALONE_NARROW_WEEKDAYS,
1414 UDAT_QUARTERS,
1416 UDAT_SHORT_QUARTERS,
1418 UDAT_STANDALONE_QUARTERS,
1419 UDAT_STANDALONE_SHORT_QUARTERS,
1427 UDAT_SHORTER_WEEKDAYS,
1432 UDAT_STANDALONE_SHORTER_WEEKDAYS,
1438 UDAT_CYCLIC_YEARS_WIDE,
1443 UDAT_CYCLIC_YEARS_ABBREVIATED,
1449 UDAT_CYCLIC_YEARS_NARROW,
1455 UDAT_ZODIAC_NAMES_WIDE,
1460 UDAT_ZODIAC_NAMES_ABBREVIATED,
1466 UDAT_ZODIAC_NAMES_NARROW
1467 } UDateFormatSymbolType;
1468
1469 struct UDateFormatSymbols;
1474 typedef struct UDateFormatSymbols UDateFormatSymbols;
1475
1492 U_STABLE int32_t U_EXPORT2
1493 udat_getSymbols(const UDateFormat *fmt,
1494 UDateFormatSymbolType type,
1495 int32_t symbolIndex,
1496 UChar *result,
1497 int32_t resultLength,
1498 UErrorCode *status);
1499
1512 U_STABLE int32_t U_EXPORT2
1513 udat_countSymbols( const UDateFormat *fmt,
1514 UDateFormatSymbolType type);
1515
1531 U_STABLE void U_EXPORT2
1532 udat_setSymbols( UDateFormat *format,
1533 UDateFormatSymbolType type,
1534 int32_t symbolIndex,
1535 UChar *value,
1536 int32_t valueLength,
1537 UErrorCode *status);
1538
1548 U_STABLE const char* U_EXPORT2
1549 udat_getLocaleByType(const UDateFormat *fmt,
1550 ULocDataLocaleType type,
1551 UErrorCode* status);
1552
1561 U_DRAFT void U_EXPORT2
1562 udat_setContext(UDateFormat* fmt, UDisplayContext value, UErrorCode* status);
1563
1573 U_STABLE UDisplayContext U_EXPORT2
1574 udat_getContext(const UDateFormat* fmt, UDisplayContextType type, UErrorCode* status);
1575
1576 #ifndef U_HIDE_INTERNAL_API
1577
1588 U_INTERNAL int32_t U_EXPORT2
1589 udat_toPatternRelativeDate(const UDateFormat *fmt,
1590 UChar *result,
1591 int32_t resultLength,
1592 UErrorCode *status);
1593
1605 U_INTERNAL int32_t U_EXPORT2
1606 udat_toPatternRelativeTime(const UDateFormat *fmt,
1607 UChar *result,
1608 int32_t resultLength,
1609 UErrorCode *status);
1610
1623 U_INTERNAL void U_EXPORT2
1624 udat_applyPatternRelative(UDateFormat *format,
1625 const UChar *datePattern,
1626 int32_t datePatternLength,
1627 const UChar *timePattern,
1628 int32_t timePatternLength,
1629 UErrorCode *status);
1630
1635 typedef UDateFormat* (U_EXPORT2 *UDateFormatOpener) (UDateFormatStyle timeStyle,
1636 UDateFormatStyle dateStyle,
1637 const char *locale,
1638 const UChar *tzID,
1639 int32_t tzIDLength,
1640 const UChar *pattern,
1641 int32_t patternLength,
1642 UErrorCode *status);
1643
1648 U_INTERNAL void U_EXPORT2
1649 udat_registerOpener(UDateFormatOpener opener, UErrorCode *status);
1650
1655 U_INTERNAL UDateFormatOpener U_EXPORT2
1656 udat_unregisterOpener(UDateFormatOpener opener, UErrorCode *status);
1657 #endif /* U_HIDE_INTERNAL_API */
1658
1659
1660 #endif /* #if !UCONFIG_NO_FORMATTING */
1661
1662 #endif
udat_format
int32_t udat_format(const UDateFormat *format, UDate dateToFormat, UChar *result, int32_t resultLength, UFieldPosition *position, UErrorCode *status)
Format a date using a UDateFormat.
UCalendar
void * UCalendar
A calendar.
Definition: ucal.h:155
UDAT_WEEK_OF_YEAR_FIELD
FieldPosition and UFieldPosition selector for &#39;w&#39; field alignment, corresponding to the UCAL_WEEK_OF_...
Definition: udat.h:592
UDAT_AM_PM_MIDNIGHT_NOON_FIELD
FieldPosition selector for &#39;b&#39; field alignment.
Definition: udat.h:773
UDAT_DOW_LOCAL_FIELD
FieldPosition and UFieldPosition selector for &#39;e&#39; field alignment, corresponding to the UCAL_DOW_LOCA...
Definition: udat.h:646
UDAT_SHORTER_WEEKDAYS
The CLDR-style short weekday names, e.g.
Definition: udat.h:1427
UDAT_STANDALONE_MONTHS
Standalone context versions of months.
Definition: udat.h:1401
UCalendarDateFields
UCalendarDateFields
Possible fields in a UCalendar.
Definition: ucal.h:185
udat_isLenient
UBool udat_isLenient(const UDateFormat *fmt)
Determine if an UDateFormat will perform lenient parsing.
UDAT_PARSE_PARTIAL_LITERAL_MATCH
indicates tolerance of a partial literal match e.g.
Definition: udat.h:897
UDAT_LOCALIZED_CHARS
The localized characters.
Definition: udat.h:1393
UDAT_TIMEZONE_SPECIAL_FIELD
FieldPosition and UFieldPosition selector for &#39;V&#39; field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:722
UDAT_NARROW_WEEKDAYS
The CLDR-style format "narrow" weekday names, for example "M".
Definition: udat.h:1399
UDAT_QUARTER_FIELD
FieldPosition selector for "Q" field alignment, corresponding to quarters.
Definition: udat.h:706
ucal.h
C API: Calendar.
udat_getNumberFormatForField
const UNumberFormat * udat_getNumberFormatForField(const UDateFormat *fmt, UChar field)
Get the UNumberFormat for specific field associated with an UDateFormat.
UDAT_MONTH_FIELD
FieldPosition and UFieldPosition selector for &#39;M&#39; field alignment, corresponding to the UCAL_MONTH fi...
Definition: udat.h:510
udat_adoptNumberFormat
void udat_adoptNumberFormat(UDateFormat *fmt, UNumberFormat *numberFormatToAdopt)
Adopt the UNumberFormat associated with an UDateFormat.
udat_getBooleanAttribute
UBool udat_getBooleanAttribute(const UDateFormat *fmt, UDateFormatBooleanAttribute attr, UErrorCode *status)
Get a boolean attribute associated with a UDateFormat.
UDAT_HOUR_OF_DAY1_FIELD
FieldPosition and UFieldPosition selector for &#39;k&#39; field alignment, corresponding to the UCAL_HOUR_OF_...
Definition: udat.h:526
udat_getLocaleByType
const char * udat_getLocaleByType(const UDateFormat *fmt, ULocDataLocaleType type, UErrorCode *status)
Get the locale for this date format object.
UDAT_ERA_NAMES
The long era names, for example Anno Domini.
Definition: udat.h:1395
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_ZODIAC_NAMES_NARROW
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols ...
Definition: udat.h:1466
UDAT_SHORT
Short style.
Definition: udat.h:166
UDAT_QUARTERS
The quarters, for example 1st Quarter.
Definition: udat.h:1414
udat_registerOpener
void udat_registerOpener(UDateFormatOpener opener, UErrorCode *status)
Register a provider factory.
UDisplayContext
UDisplayContext
Display context settings.
Definition: udisplaycontext.h:66
UDate
double UDate
Date and Time data type.
Definition: utypes.h:203
UDAT_NONE
No style.
Definition: udat.h:183
UDAT_STANDALONE_WEEKDAYS
The CLDR-style stand-alone "wide" weekday names.
Definition: udat.h:1405
UDAT_LONG
Long style.
Definition: udat.h:162
UDAT_TIMEZONE_ISO_FIELD
FieldPosition selector for &#39;X&#39; field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
Definition: udat.h:747
udat_setCalendar
void udat_setCalendar(UDateFormat *fmt, const UCalendar *calendarToSet)
Set the UCalendar associated with an UDateFormat.
UFieldPositionIterator
struct UFieldPositionIterator UFieldPositionIterator
C typedef for struct UFieldPositionIterator.
Definition: ufieldpositer.h:44
UDAT_SHORT_MONTHS
The short month names, for example Feb.
Definition: udat.h:1382
U_INTERNAL
#define U_INTERNAL
This is used to declare a function as an internal ICU C API.
Definition: umachine.h:142
UDAT_PATTERN
Use the pattern given in the parameter to udat_open.
Definition: udat.h:190
UDAT_DEFAULT
Default style.
Definition: udat.h:168
udat_getNumberFormat
const UNumberFormat * udat_getNumberFormat(const UDateFormat *fmt)
Get the UNumberFormat associated with an UDateFormat.
UDAT_BOOLEAN_ATTRIBUTE_COUNT
One more than the highest normal UDateFormatBooleanAttribute value.
Definition: udat.h:911
udat_setLenient
void udat_setLenient(UDateFormat *fmt, UBool isLenient)
Specify whether an UDateFormat will perform lenient parsing.
U_HIDE_INTERNAL_API
#define U_HIDE_INTERNAL_API
Define this to 1 to request that internal API be "hidden".
Definition: utypes.h:87
udisplaycontext.h
C API: Display context types (enum values)
UDAT_JULIAN_DAY_FIELD
FieldPosition and UFieldPosition selector for &#39;g&#39; field alignment, corresponding to the UCAL_JULIAN_D...
Definition: udat.h:660
udat_getCalendar
const UCalendar * udat_getCalendar(const UDateFormat *fmt)
Get the UCalendar associated with an UDateFormat.
UDAT_PARSE_ALLOW_NUMERIC
indicates tolerance of numeric data when String data may be assumed.
Definition: udat.h:891
UDAT_RELATIVE
Bitfield for relative date.
Definition: udat.h:171
UDAT_DAY_OF_YEAR_FIELD
FieldPosition and UFieldPosition selector for &#39;D&#39; field alignment, corresponding to the UCAL_DAY_OF_Y...
Definition: udat.h:578
UDAT_STANDALONE_QUARTER_FIELD
FieldPosition selector for the "q" field alignment, corresponding to stand-alone quarters.
Definition: udat.h:715
UDAT_EXTENDED_YEAR_FIELD
FieldPosition and UFieldPosition selector for &#39;u&#39; field alignment, corresponding to the UCAL_EXTENDED...
Definition: udat.h:653
UDAT_RELATED_YEAR_FIELD
FieldPosition and UFieldPosition selector for &#39;r&#39; field alignment, no directly corresponding UCAL_ fi...
Definition: udat.h:763
UDAT_IGNORE
Definition: udat.h:194
udat_setSymbols
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_setNumberFormat
void udat_setNumberFormat(UDateFormat *fmt, const UNumberFormat *numberFormatToSet)
Set the UNumberFormat associated with an UDateFormat.
udat_setContext
void udat_setContext(UDateFormat *fmt, UDisplayContext value, UErrorCode *status)
Set a particular UDisplayContext value in the formatter, such as UDISPCTX_CAPITALIZATION_FOR_STANDALO...
UDAT_STANDALONE_DAY_FIELD
FieldPosition selector for &#39;c&#39; field alignment, corresponding to the UCAL_DOW_LOCAL field...
Definition: udat.h:689
udat_getContext
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...
UDAT_DATE_FIELD
FieldPosition and UFieldPosition selector for &#39;d&#39; field alignment, corresponding to the UCAL_DATE fie...
Definition: udat.h:517
udat_close
void udat_close(UDateFormat *format)
Close a UDateFormat.
UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH
indicates tolerance of pattern mismatch between input data and specified format pattern.
Definition: udat.h:903
UDAT_FULL
Full style.
Definition: udat.h:160
UDAT_TIME_SEPARATOR_FIELD
FieldPosition and UFieldPosition selector for time separator, no corresponding UCAL_ field...
Definition: udat.h:789
UDAT_YEAR_WOY_FIELD
FieldPosition and UFieldPosition selector for &#39;Y&#39; field alignment, corresponding to the UCAL_YEAR_WOY...
Definition: udat.h:639
udat_set2DigitYearStart
void udat_set2DigitYearStart(UDateFormat *fmt, UDate d, UErrorCode *status)
Set the year relative to which all 2-digit years will be interpreted.
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:131
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:1635
UDAT_DAY_OF_WEEK_IN_MONTH_FIELD
FieldPosition and UFieldPosition selector for &#39;F&#39; field alignment, corresponding to the UCAL_DAY_OF_W...
Definition: udat.h:585
UDateFormatSymbolType
UDateFormatSymbolType
The possible types of date format symbols.
Definition: udat.h:1376
UDAT_STANDALONE_NARROW_WEEKDAYS
The CLDR-style stand-alone "narrow" weekday names.
Definition: udat.h:1412
UDAT_MONTHS
The month names, for example February.
Definition: udat.h:1380
U_DEFINE_LOCAL_OPEN_POINTER
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:530
UNumberFormat
void * UNumberFormat
A number formatter.
Definition: unum.h:136
UFieldPosition
A struct representing a range of text containing a specific field.
Definition: umisc.h:34
UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD
FieldPosition selector for &#39;O&#39; field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
Definition: udat.h:739
UDAT_MILLISECONDS_IN_DAY_FIELD
FieldPosition and UFieldPosition selector for &#39;A&#39; field alignment, corresponding to the UCAL_MILLISEC...
Definition: udat.h:667
udat_formatCalendar
int32_t udat_formatCalendar(const UDateFormat *format, UCalendar *calendar, UChar *result, int32_t capacity, UFieldPosition *position, UErrorCode *status)
Format a date using an UDateFormat.
UDAT_PARSE_ALLOW_WHITESPACE
indicates whether whitespace is allowed.
Definition: udat.h:885
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
UDateFormat
void * UDateFormat
A date formatter.
Definition: udat.h:153
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_TIMEZONE_GENERIC_FIELD
FieldPosition and UFieldPosition selector for &#39;v&#39; field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:682
UDAT_ERAS
The era names, for example AD.
Definition: udat.h:1378
UDAT_CYCLIC_YEARS_WIDE
Cyclic year names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols not ...
Definition: udat.h:1438
UDAT_WEEK_OF_MONTH_FIELD
FieldPosition and UFieldPosition selector for &#39;W&#39; field alignment, corresponding to the UCAL_WEEK_OF_...
Definition: udat.h:599
UDAT_WEEKDAYS
The CLDR-style format "wide" weekday names, for example Monday.
Definition: udat.h:1384
udat_toCalendarDateField
UCalendarDateFields udat_toCalendarDateField(UDateFormatField field)
Maps from a UDateFormatField to the corresponding UCalendarDateFields.
UDateFormatSymbols
struct UDateFormatSymbols UDateFormatSymbols
Date format symbols.
Definition: udat.h:1474
UDateFormatStyle
UDateFormatStyle
The possible date/time format styles.
Definition: udat.h:158
udat_parse
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_open
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_formatCalendarForFields
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_ZODIAC_NAMES_WIDE
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols ...
Definition: udat.h:1455
udat_applyPattern
void udat_applyPattern(UDateFormat *format, UBool localized, const UChar *pattern, int32_t patternLength)
Set the pattern used by an UDateFormat.
UDAT_DAY_OF_WEEK_FIELD
FieldPosition and UFieldPosition selector for &#39;E&#39; field alignment, corresponding to the UCAL_DAY_OF_W...
Definition: udat.h:571
udat_toPattern
int32_t udat_toPattern(const UDateFormat *fmt, UBool localized, UChar *result, int32_t resultLength, UErrorCode *status)
Extract the pattern from a UDateFormat.
UDAT_AM_PM_FIELD
FieldPosition and UFieldPosition selector for &#39;a&#39; field alignment, corresponding to the UCAL_AM_PM fi...
Definition: udat.h:606
LocalUDateFormatPointer
"Smart pointer" class, closes a UDateFormat via udat_close().
UDAT_SHORT_QUARTERS
The short quarter names, for example Q1.
Definition: udat.h:1416
UDAT_CYCLIC_YEARS_NARROW
Cyclic year names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols not ...
Definition: udat.h:1449
UDAT_HOUR0_FIELD
FieldPosition and UFieldPosition selector for &#39;K&#39; field alignment, corresponding to the UCAL_HOUR fie...
Definition: udat.h:624
udat_getAvailable
const char * udat_getAvailable(int32_t localeIndex)
Get a locale for which date/time formatting patterns are available.
udat_getSymbols
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.
UChar
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
Definition: umachine.h:337
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:132
UDisplayContextType
UDisplayContextType
Display context types, for getting values of a particular setting.
Definition: udisplaycontext.h:27
udat_adoptNumberFormatForFields
void udat_adoptNumberFormatForFields(UDateFormat *fmt, const UChar *fields, UNumberFormat *numberFormatToSet, UErrorCode *status)
Set the UNumberFormat for specific field associated with an UDateFormat.
udat_setBooleanAttribute
void udat_setBooleanAttribute(UDateFormat *fmt, UDateFormatBooleanAttribute attr, UBool newValue, UErrorCode *status)
Set a boolean attribute associated with a UDateFormat.
UDAT_STANDALONE_QUARTERS
Standalone context versions of quarters.
Definition: udat.h:1418
UDateFormatField
UDateFormatField
FieldPosition and UFieldPosition selectors for format fields defined by DateFormat and UDateFormat...
Definition: udat.h:490
UDAT_ERA_FIELD
FieldPosition and UFieldPosition selector for &#39;G&#39; field alignment, corresponding to the UCAL_ERA fiel...
Definition: udat.h:496
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:396
udat_clone
UDateFormat * udat_clone(const UDateFormat *fmt, UErrorCode *status)
Open a copy of a UDateFormat.
ULocDataLocaleType
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested...
Definition: uloc.h:338
UDAT_MINUTE_FIELD
FieldPosition and UFieldPosition selector for &#39;m&#39; field alignment, corresponding to the UCAL_MINUTE f...
Definition: udat.h:542
udat_countSymbols
int32_t udat_countSymbols(const UDateFormat *fmt, UDateFormatSymbolType type)
Count the number of particular symbols for an UDateFormat.
UDAT_STANDALONE_SHORT_WEEKDAYS
The CLDR-style stand-alone "abbreviated" (not "short") weekday names.
Definition: udat.h:1410
UDAT_NARROW_MONTHS
The narrow month names, for example F.
Definition: udat.h:1397
UDAT_CYCLIC_YEARS_ABBREVIATED
Cyclic year names (only supported for some calendars, and only for FORMAT usage)
Definition: udat.h:1443
UDAT_TIMEZONE_ISO_LOCAL_FIELD
FieldPosition selector for &#39;x&#39; field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
Definition: udat.h:755
udat_formatForFields
int32_t udat_formatForFields(const UDateFormat *format, UDate dateToFormat, UChar *result, int32_t resultLength, UFieldPositionIterator *fpositer, UErrorCode *status)
Format a date using a UDateFormat.
ufieldpositer.h
C API: UFieldPositionIterator for use with format APIs.
UDAT_SECOND_FIELD
FieldPosition and UFieldPosition selector for &#39;s&#39; field alignment, corresponding to the UCAL_SECOND f...
Definition: udat.h:549
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UDAT_SHORT_WEEKDAYS
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:1389
UDAT_TIMEZONE_FIELD
FieldPosition and UFieldPosition selector for &#39;z&#39; field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:632
UDAT_YEAR_FIELD
FieldPosition and UFieldPosition selector for &#39;y&#39; field alignment, corresponding to the UCAL_YEAR fie...
Definition: udat.h:503
UDAT_STANDALONE_MONTH_FIELD
FieldPosition selector for &#39;L&#39; field alignment, corresponding to the UCAL_MONTH field.
Definition: udat.h:697
UDAT_AM_PMS
The AM/PM names, for example AM.
Definition: udat.h:1391
UDAT_FIELD_COUNT
Number of FieldPosition and UFieldPosition selectors for DateFormat and UDateFormat.
Definition: udat.h:799
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.
UDAT_TIMEZONE_RFC_FIELD
FieldPosition and UFieldPosition selector for &#39;Z&#39; field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:675
udat_get2DigitYearStart
UDate udat_get2DigitYearStart(const UDateFormat *fmt, UErrorCode *status)
Get the year relative to which all 2-digit years are interpreted.
udat_countAvailable
int32_t udat_countAvailable(void)
Determine how many locales have date/time formatting patterns available.
U_DRAFT
#define U_DRAFT
This is used to declare a function as a draft public ICU C API.
Definition: umachine.h:136
UDAT_HOUR_OF_DAY0_FIELD
FieldPosition and UFieldPosition selector for &#39;H&#39; field alignment, corresponding to the UCAL_HOUR_OF_...
Definition: udat.h:535
UDateFormatBooleanAttribute
UDateFormatBooleanAttribute
DateFormat boolean attributes.
Definition: udat.h:880
UDAT_FRACTIONAL_SECOND_FIELD
FieldPosition and UFieldPosition selector for &#39;S&#39; field alignment, corresponding to the UCAL_MILLISEC...
Definition: udat.h:564
UDAT_HOUR1_FIELD
FieldPosition and UFieldPosition selector for &#39;h&#39; field alignment, corresponding to the UCAL_HOUR fie...
Definition: udat.h:615
UDAT_ZODIAC_NAMES_ABBREVIATED
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage) ...
Definition: udat.h:1460
udat_unregisterOpener
UDateFormatOpener udat_unregisterOpener(UDateFormatOpener opener, UErrorCode *status)
Un-Register a provider factory.
UDAT_YEAR_NAME_FIELD
FieldPosition selector for "U" field alignment, corresponding to cyclic year names.
Definition: udat.h:731
udat_parseCalendar
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_STABLE
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:134
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:259
unum.h
C API: NumberFormat.
UDAT_MEDIUM
Medium style.
Definition: udat.h:164
UDAT_STANDALONE_SHORTER_WEEKDAYS
Standalone version of UDAT_SHORTER_WEEKDAYS.
Definition: udat.h:1432