ICU 56.1: udat.h Source File

ICU 56.1 56.1

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

- File List
- Globals

udat.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 * Copyright (C) 1996-2015, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 *******************************************************************************
6 */
7
8 #ifndef UDAT_H
9 #define UDAT_H
10
11 #include "unicode/utypes.h"
12
13 #if !UCONFIG_NO_FORMATTING
14
15 #include "unicode/localpointer.h"
16 #include "unicode/ucal.h"
17 #include "unicode/unum.h"
18 #include "unicode/udisplaycontext.h"
19 #include "unicode/ufieldpositer.h"
151 typedef void* UDateFormat;
152
156 typedef enum UDateFormatStyle {
158 UDAT_FULL,
160 UDAT_LONG,
162 UDAT_MEDIUM,
164 UDAT_SHORT,
166 UDAT_DEFAULT = UDAT_MEDIUM,
167
169 UDAT_RELATIVE = (1 << 7),
170
171 UDAT_FULL_RELATIVE = UDAT_FULL | UDAT_RELATIVE,
172
173 UDAT_LONG_RELATIVE = UDAT_LONG | UDAT_RELATIVE,
174
175 UDAT_MEDIUM_RELATIVE = UDAT_MEDIUM | UDAT_RELATIVE,
176
177 UDAT_SHORT_RELATIVE = UDAT_SHORT | UDAT_RELATIVE,
178
179
181 UDAT_NONE = -1,
182
188 UDAT_PATTERN = -2,
189
190 #ifndef U_HIDE_INTERNAL_API
192 UDAT_IGNORE = UDAT_PATTERN
193 #endif /* U_HIDE_INTERNAL_API */
194 } UDateFormatStyle;
195
196 /* Skeletons for dates. */
197
202 #define UDAT_YEAR "y"
203
207 #define UDAT_QUARTER "QQQQ"
208
212 #define UDAT_ABBR_QUARTER "QQQ"
213
217 #define UDAT_YEAR_QUARTER "yQQQQ"
218
222 #define UDAT_YEAR_ABBR_QUARTER "yQQQ"
223
227 #define UDAT_MONTH "MMMM"
228
232 #define UDAT_ABBR_MONTH "MMM"
233
237 #define UDAT_NUM_MONTH "M"
238
242 #define UDAT_YEAR_MONTH "yMMMM"
243
247 #define UDAT_YEAR_ABBR_MONTH "yMMM"
248
252 #define UDAT_YEAR_NUM_MONTH "yM"
253
257 #define UDAT_DAY "d"
258
263 #define UDAT_YEAR_MONTH_DAY "yMMMMd"
264
269 #define UDAT_YEAR_ABBR_MONTH_DAY "yMMMd"
270
275 #define UDAT_YEAR_NUM_MONTH_DAY "yMd"
276
280 #define UDAT_WEEKDAY "EEEE"
281
285 #define UDAT_ABBR_WEEKDAY "E"
286
291 #define UDAT_YEAR_MONTH_WEEKDAY_DAY "yMMMMEEEEd"
292
297 #define UDAT_YEAR_ABBR_MONTH_WEEKDAY_DAY "yMMMEd"
298
303 #define UDAT_YEAR_NUM_MONTH_WEEKDAY_DAY "yMEd"
304
309 #define UDAT_MONTH_DAY "MMMMd"
310
315 #define UDAT_ABBR_MONTH_DAY "MMMd"
316
321 #define UDAT_NUM_MONTH_DAY "Md"
322
327 #define UDAT_MONTH_WEEKDAY_DAY "MMMMEEEEd"
328
333 #define UDAT_ABBR_MONTH_WEEKDAY_DAY "MMMEd"
334
339 #define UDAT_NUM_MONTH_WEEKDAY_DAY "MEd"
340
341 /* Skeletons for times. */
342
347 #define UDAT_HOUR "j"
348
352 #define UDAT_HOUR24 "H"
353
357 #define UDAT_MINUTE "m"
358
363 #define UDAT_HOUR_MINUTE "jm"
364
369 #define UDAT_HOUR24_MINUTE "Hm"
370
374 #define UDAT_SECOND "s"
375
381 #define UDAT_HOUR_MINUTE_SECOND "jms"
382
388 #define UDAT_HOUR24_MINUTE_SECOND "Hms"
389
394 #define UDAT_MINUTE_SECOND "ms"
395
396 /* Skeletons for time zones. */
397
405 #define UDAT_LOCATION_TZ "VVVV"
406
413 #define UDAT_GENERIC_TZ "vvvv"
414
421 #define UDAT_ABBR_GENERIC_TZ "v"
422
429 #define UDAT_SPECIFIC_TZ "zzzz"
430
437 #define UDAT_ABBR_SPECIFIC_TZ "z"
438
445 #define UDAT_ABBR_UTC_TZ "ZZZZ"
446
447 /* deprecated skeleton constants */
448
449 #ifndef U_HIDE_DEPRECATED_API
450
454 #define UDAT_STANDALONE_MONTH "LLLL"
455
459 #define UDAT_ABBR_STANDALONE_MONTH "LLL"
460
465 #define UDAT_HOUR_MINUTE_GENERIC_TZ "jmv"
466
470 #define UDAT_HOUR_MINUTE_TZ "jmz"
471
475 #define UDAT_HOUR_GENERIC_TZ "jv"
476
480 #define UDAT_HOUR_TZ "jz"
481 #endif /* U_HIDE_DEPRECATED_API */
482
488 typedef enum UDateFormatField {
494 UDAT_ERA_FIELD = 0,
495
501 UDAT_YEAR_FIELD = 1,
502
508 UDAT_MONTH_FIELD = 2,
509
515 UDAT_DATE_FIELD = 3,
516
524 UDAT_HOUR_OF_DAY1_FIELD = 4,
525
533 UDAT_HOUR_OF_DAY0_FIELD = 5,
534
540 UDAT_MINUTE_FIELD = 6,
541
547 UDAT_SECOND_FIELD = 7,
548
562 UDAT_FRACTIONAL_SECOND_FIELD = 8,
563
569 UDAT_DAY_OF_WEEK_FIELD = 9,
570
576 UDAT_DAY_OF_YEAR_FIELD = 10,
577
583 UDAT_DAY_OF_WEEK_IN_MONTH_FIELD = 11,
584
590 UDAT_WEEK_OF_YEAR_FIELD = 12,
591
597 UDAT_WEEK_OF_MONTH_FIELD = 13,
598
604 UDAT_AM_PM_FIELD = 14,
605
613 UDAT_HOUR1_FIELD = 15,
614
622 UDAT_HOUR0_FIELD = 16,
623
630 UDAT_TIMEZONE_FIELD = 17,
631
637 UDAT_YEAR_WOY_FIELD = 18,
638
644 UDAT_DOW_LOCAL_FIELD = 19,
645
651 UDAT_EXTENDED_YEAR_FIELD = 20,
652
658 UDAT_JULIAN_DAY_FIELD = 21,
659
665 UDAT_MILLISECONDS_IN_DAY_FIELD = 22,
666
673 UDAT_TIMEZONE_RFC_FIELD = 23,
674
680 UDAT_TIMEZONE_GENERIC_FIELD = 24,
687 UDAT_STANDALONE_DAY_FIELD = 25,
688
695 UDAT_STANDALONE_MONTH_FIELD = 26,
696
704 UDAT_QUARTER_FIELD = 27,
705
713 UDAT_STANDALONE_QUARTER_FIELD = 28,
714
720 UDAT_TIMEZONE_SPECIAL_FIELD = 29,
721
729 UDAT_YEAR_NAME_FIELD = 30,
730
737 UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31,
738
745 UDAT_TIMEZONE_ISO_FIELD = 32,
746
753 UDAT_TIMEZONE_ISO_LOCAL_FIELD = 33,
754
755 #ifndef U_HIDE_INTERNAL_API
756
761 UDAT_RELATED_YEAR_FIELD = 34,
762 #endif /* U_HIDE_INTERNAL_API */
763
764 #ifndef U_HIDE_DRAFT_API
765
771 UDAT_TIME_SEPARATOR_FIELD = 35,
772 #endif /* U_HIDE_DRAFT_API */
773
782 UDAT_FIELD_COUNT = 36
783
784 } UDateFormatField;
785
786
787 #ifndef U_HIDE_INTERNAL_API
788
793 #define UDAT_HAS_PATTERN_CHAR_FOR_TIME_SEPARATOR 0
794 #endif /* U_HIDE_INTERNAL_API */
795
796
805 U_STABLE UCalendarDateFields U_EXPORT2
806 udat_toCalendarDateField(UDateFormatField field);
807
808
837 U_STABLE UDateFormat* U_EXPORT2
838 udat_open(UDateFormatStyle timeStyle,
839 UDateFormatStyle dateStyle,
840 const char *locale,
841 const UChar *tzID,
842 int32_t tzIDLength,
843 const UChar *pattern,
844 int32_t patternLength,
845 UErrorCode *status);
846
847
854 U_STABLE void U_EXPORT2
855 udat_close(UDateFormat* format);
856
857
863 typedef enum UDateFormatBooleanAttribute {
868 UDAT_PARSE_ALLOW_WHITESPACE = 0,
874 UDAT_PARSE_ALLOW_NUMERIC = 1,
875 #ifndef U_HIDE_DRAFT_API
876
881 UDAT_PARSE_PARTIAL_LITERAL_MATCH = 2,
887 UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH = 3,
888 #endif /* U_HIDE_DRAFT_API */
889
893 UDAT_BOOLEAN_ATTRIBUTE_COUNT = 4
894 } UDateFormatBooleanAttribute;
895
906 U_STABLE UBool U_EXPORT2
907 udat_getBooleanAttribute(const UDateFormat* fmt, UDateFormatBooleanAttribute attr, UErrorCode* status);
908
919 U_STABLE void U_EXPORT2
920 udat_setBooleanAttribute(UDateFormat *fmt, UDateFormatBooleanAttribute attr, UBool newValue, UErrorCode* status);
921
922
923
924 #if U_SHOW_CPLUSPLUS_API
925
926 U_NAMESPACE_BEGIN
927
937 U_DEFINE_LOCAL_OPEN_POINTER(LocalUDateFormatPointer, UDateFormat, udat_close);
938
939 U_NAMESPACE_END
940
941 #endif
942
951 U_STABLE UDateFormat* U_EXPORT2
952 udat_clone(const UDateFormat *fmt,
953 UErrorCode *status);
954
973 U_STABLE int32_t U_EXPORT2
974 udat_format( const UDateFormat* format,
975 UDate dateToFormat,
976 UChar* result,
977 int32_t resultLength,
978 UFieldPosition* position,
979 UErrorCode* status);
980
981 #ifndef U_HIDE_DRAFT_API
982
1004 U_DRAFT int32_t U_EXPORT2
1005 udat_formatCalendar( const UDateFormat* format,
1006 UCalendar* calendar,
1007 UChar* result,
1008 int32_t capacity,
1009 UFieldPosition* position,
1010 UErrorCode* status);
1011
1039 U_DRAFT int32_t U_EXPORT2
1040 udat_formatForFields( const UDateFormat* format,
1041 UDate dateToFormat,
1042 UChar* result,
1043 int32_t resultLength,
1044 UFieldPositionIterator* fpositer,
1045 UErrorCode* status);
1046
1077 U_DRAFT int32_t U_EXPORT2
1078 udat_formatCalendarForFields( const UDateFormat* format,
1079 UCalendar* calendar,
1080 UChar* result,
1081 int32_t capacity,
1082 UFieldPositionIterator* fpositer,
1083 UErrorCode* status);
1084
1085 #endif /* U_HIDE_DRAFT_API */
1086
1112 U_STABLE UDate U_EXPORT2
1113 udat_parse(const UDateFormat* format,
1114 const UChar* text,
1115 int32_t textLength,
1116 int32_t *parsePos,
1117 UErrorCode *status);
1118
1140 U_STABLE void U_EXPORT2
1141 udat_parseCalendar(const UDateFormat* format,
1142 UCalendar* calendar,
1143 const UChar* text,
1144 int32_t textLength,
1145 int32_t *parsePos,
1146 UErrorCode *status);
1147
1157 U_STABLE UBool U_EXPORT2
1158 udat_isLenient(const UDateFormat* fmt);
1159
1169 U_STABLE void U_EXPORT2
1170 udat_setLenient( UDateFormat* fmt,
1171 UBool isLenient);
1172
1182 U_STABLE const UCalendar* U_EXPORT2
1183 udat_getCalendar(const UDateFormat* fmt);
1184
1194 U_STABLE void U_EXPORT2
1195 udat_setCalendar( UDateFormat* fmt,
1196 const UCalendar* calendarToSet);
1197
1207 U_STABLE const UNumberFormat* U_EXPORT2
1208 udat_getNumberFormat(const UDateFormat* fmt);
1209
1219 U_STABLE const UNumberFormat* U_EXPORT2
1220 udat_getNumberFormatForField(const UDateFormat* fmt, UChar field);
1221
1237 U_STABLE void U_EXPORT2
1238 udat_adoptNumberFormatForFields( UDateFormat* fmt,
1239 const UChar* fields,
1240 UNumberFormat* numberFormatToSet,
1241 UErrorCode* status);
1254 U_STABLE void U_EXPORT2
1255 udat_setNumberFormat( UDateFormat* fmt,
1256 const UNumberFormat* numberFormatToSet);
1266 U_STABLE void U_EXPORT2
1267 udat_adoptNumberFormat( UDateFormat* fmt,
1268 UNumberFormat* numberFormatToAdopt);
1278 U_STABLE const char* U_EXPORT2
1279 udat_getAvailable(int32_t localeIndex);
1280
1289 U_STABLE int32_t U_EXPORT2
1290 udat_countAvailable(void);
1291
1302 U_STABLE UDate U_EXPORT2
1303 udat_get2DigitYearStart( const UDateFormat *fmt,
1304 UErrorCode *status);
1305
1316 U_STABLE void U_EXPORT2
1317 udat_set2DigitYearStart( UDateFormat *fmt,
1318 UDate d,
1319 UErrorCode *status);
1320
1333 U_STABLE int32_t U_EXPORT2
1334 udat_toPattern( const UDateFormat *fmt,
1335 UBool localized,
1336 UChar *result,
1337 int32_t resultLength,
1338 UErrorCode *status);
1339
1350 U_STABLE void U_EXPORT2
1351 udat_applyPattern( UDateFormat *format,
1352 UBool localized,
1353 const UChar *pattern,
1354 int32_t patternLength);
1355
1360 typedef enum UDateFormatSymbolType {
1362 UDAT_ERAS,
1364 UDAT_MONTHS,
1366 UDAT_SHORT_MONTHS,
1368 UDAT_WEEKDAYS,
1373 UDAT_SHORT_WEEKDAYS,
1375 UDAT_AM_PMS,
1377 UDAT_LOCALIZED_CHARS,
1379 UDAT_ERA_NAMES,
1381 UDAT_NARROW_MONTHS,
1383 UDAT_NARROW_WEEKDAYS,
1385 UDAT_STANDALONE_MONTHS,
1386 UDAT_STANDALONE_SHORT_MONTHS,
1387 UDAT_STANDALONE_NARROW_MONTHS,
1389 UDAT_STANDALONE_WEEKDAYS,
1394 UDAT_STANDALONE_SHORT_WEEKDAYS,
1396 UDAT_STANDALONE_NARROW_WEEKDAYS,
1398 UDAT_QUARTERS,
1400 UDAT_SHORT_QUARTERS,
1402 UDAT_STANDALONE_QUARTERS,
1403 UDAT_STANDALONE_SHORT_QUARTERS,
1411 UDAT_SHORTER_WEEKDAYS,
1416 UDAT_STANDALONE_SHORTER_WEEKDAYS,
1422 UDAT_CYCLIC_YEARS_WIDE,
1427 UDAT_CYCLIC_YEARS_ABBREVIATED,
1433 UDAT_CYCLIC_YEARS_NARROW,
1439 UDAT_ZODIAC_NAMES_WIDE,
1444 UDAT_ZODIAC_NAMES_ABBREVIATED,
1450 UDAT_ZODIAC_NAMES_NARROW
1451 } UDateFormatSymbolType;
1452
1453 struct UDateFormatSymbols;
1458 typedef struct UDateFormatSymbols UDateFormatSymbols;
1459
1476 U_STABLE int32_t U_EXPORT2
1477 udat_getSymbols(const UDateFormat *fmt,
1478 UDateFormatSymbolType type,
1479 int32_t symbolIndex,
1480 UChar *result,
1481 int32_t resultLength,
1482 UErrorCode *status);
1483
1496 U_STABLE int32_t U_EXPORT2
1497 udat_countSymbols( const UDateFormat *fmt,
1498 UDateFormatSymbolType type);
1499
1515 U_STABLE void U_EXPORT2
1516 udat_setSymbols( UDateFormat *format,
1517 UDateFormatSymbolType type,
1518 int32_t symbolIndex,
1519 UChar *value,
1520 int32_t valueLength,
1521 UErrorCode *status);
1522
1532 U_STABLE const char* U_EXPORT2
1533 udat_getLocaleByType(const UDateFormat *fmt,
1534 ULocDataLocaleType type,
1535 UErrorCode* status);
1536
1545 U_DRAFT void U_EXPORT2
1546 udat_setContext(UDateFormat* fmt, UDisplayContext value, UErrorCode* status);
1547
1557 U_STABLE UDisplayContext U_EXPORT2
1558 udat_getContext(const UDateFormat* fmt, UDisplayContextType type, UErrorCode* status);
1559
1560 #ifndef U_HIDE_INTERNAL_API
1561
1572 U_INTERNAL int32_t U_EXPORT2
1573 udat_toPatternRelativeDate(const UDateFormat *fmt,
1574 UChar *result,
1575 int32_t resultLength,
1576 UErrorCode *status);
1577
1589 U_INTERNAL int32_t U_EXPORT2
1590 udat_toPatternRelativeTime(const UDateFormat *fmt,
1591 UChar *result,
1592 int32_t resultLength,
1593 UErrorCode *status);
1594
1607 U_INTERNAL void U_EXPORT2
1608 udat_applyPatternRelative(UDateFormat *format,
1609 const UChar *datePattern,
1610 int32_t datePatternLength,
1611 const UChar *timePattern,
1612 int32_t timePatternLength,
1613 UErrorCode *status);
1614
1619 typedef UDateFormat* (U_EXPORT2 *UDateFormatOpener) (UDateFormatStyle timeStyle,
1620 UDateFormatStyle dateStyle,
1621 const char *locale,
1622 const UChar *tzID,
1623 int32_t tzIDLength,
1624 const UChar *pattern,
1625 int32_t patternLength,
1626 UErrorCode *status);
1627
1632 U_INTERNAL void U_EXPORT2
1633 udat_registerOpener(UDateFormatOpener opener, UErrorCode *status);
1634
1639 U_INTERNAL UDateFormatOpener U_EXPORT2
1640 udat_unregisterOpener(UDateFormatOpener opener, UErrorCode *status);
1641 #endif /* U_HIDE_INTERNAL_API */
1642
1643
1644 #endif /* #if !UCONFIG_NO_FORMATTING */
1645
1646 #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:153
UDAT_WEEK_OF_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'w' field alignment, corresponding to the UCAL_WEEK_OF_...
Definition: udat.h:590
UDAT_DOW_LOCAL_FIELD
FieldPosition and UFieldPosition selector for 'e' field alignment, corresponding to the UCAL_DOW_LOCA...
Definition: udat.h:644
UDAT_SHORTER_WEEKDAYS
The CLDR-style short weekday names, e.g.
Definition: udat.h:1411
UDAT_STANDALONE_MONTHS
Standalone context versions of months.
Definition: udat.h:1385
UCalendarDateFields
UCalendarDateFields
Possible fields in a UCalendar.
Definition: ucal.h:183
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:881
UDAT_LOCALIZED_CHARS
The localized characters.
Definition: udat.h:1377
UDAT_TIMEZONE_SPECIAL_FIELD
FieldPosition and UFieldPosition selector for 'V' field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:720
UDAT_NARROW_WEEKDAYS
The CLDR-style format "narrow" weekday names, for example "M".
Definition: udat.h:1383
UDAT_QUARTER_FIELD
FieldPosition selector for "Q" field alignment, corresponding to quarters.
Definition: udat.h:704
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 'M' field alignment, corresponding to the UCAL_MONTH fi...
Definition: udat.h:508
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 'k' field alignment, corresponding to the UCAL_HOUR_OF_...
Definition: udat.h:524
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:1379
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:1450
UDAT_SHORT
Short style.
Definition: udat.h:164
UDAT_QUARTERS
The quarters, for example 1st Quarter.
Definition: udat.h:1398
udat_registerOpener
void udat_registerOpener(UDateFormatOpener opener, UErrorCode *status)
Register a provider factory.
UDisplayContext
UDisplayContext
Display context settings.
Definition: udisplaycontext.h:56
UDate
double UDate
Date and Time data type.
Definition: utypes.h:201
UDAT_NONE
No style.
Definition: udat.h:181
UDAT_STANDALONE_WEEKDAYS
The CLDR-style stand-alone "wide" weekday names.
Definition: udat.h:1389
UDAT_LONG
Long style.
Definition: udat.h:160
UDAT_TIMEZONE_ISO_FIELD
FieldPosition selector for 'X' field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
Definition: udat.h:745
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:43
UDAT_SHORT_MONTHS
The short month names, for example Feb.
Definition: udat.h:1366
U_INTERNAL
#define U_INTERNAL
This is used to declare a function as an internal ICU C API.
Definition: umachine.h:117
UDAT_PATTERN
Use the pattern given in the parameter to udat_open.
Definition: udat.h:188
UDAT_DEFAULT
Default style.
Definition: udat.h:166
udat_getNumberFormat
const UNumberFormat * udat_getNumberFormat(const UDateFormat *fmt)
Get the UNumberFormat associated with an UDateFormat.
UDAT_BOOLEAN_ATTRIBUTE_COUNT
count boolean date format constants
Definition: udat.h:893
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:85
udisplaycontext.h
C API: Display context types (enum values)
UDAT_JULIAN_DAY_FIELD
FieldPosition and UFieldPosition selector for 'g' field alignment, corresponding to the UCAL_JULIAN_D...
Definition: udat.h:658
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:874
UDAT_RELATIVE
Bitfield for relative date.
Definition: udat.h:169
UDAT_DAY_OF_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'D' field alignment, corresponding to the UCAL_DAY_OF_Y...
Definition: udat.h:576
UDAT_STANDALONE_QUARTER_FIELD
FieldPosition selector for the "q" field alignment, corresponding to stand-alone quarters.
Definition: udat.h:713
UDAT_EXTENDED_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'u' field alignment, corresponding to the UCAL_EXTENDED...
Definition: udat.h:651
UDAT_RELATED_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'r' field alignment, no directly corresponding UCAL_ fi...
Definition: udat.h:761
UDAT_IGNORE
Definition: udat.h:192
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 'c' field alignment, corresponding to the UCAL_DOW_LOCAL field...
Definition: udat.h:687
udat_getContext
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_DATE_FIELD
FieldPosition and UFieldPosition selector for 'd' field alignment, corresponding to the UCAL_DATE fie...
Definition: udat.h:515
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:887
UDAT_FULL
Full style.
Definition: udat.h:158
UDAT_TIME_SEPARATOR_FIELD
FieldPosition and UFieldPosition selector for time separator, no corresponding UCAL_ field...
Definition: udat.h:771
UDAT_YEAR_WOY_FIELD
FieldPosition and UFieldPosition selector for 'Y' field alignment, corresponding to the UCAL_YEAR_WOY...
Definition: udat.h:637
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:129
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:1619
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:583
UDateFormatSymbolType
UDateFormatSymbolType
The possible types of date format symbols.
Definition: udat.h:1360
UDAT_STANDALONE_NARROW_WEEKDAYS
The CLDR-style stand-alone "narrow" weekday names.
Definition: udat.h:1396
UDAT_MONTHS
The month names, for example February.
Definition: udat.h:1364
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:535
UNumberFormat
void * UNumberFormat
A number formatter.
Definition: unum.h:134
UFieldPosition
A struct representing a range of text containing a specific field.
Definition: umisc.h:32
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:737
UDAT_MILLISECONDS_IN_DAY_FIELD
FieldPosition and UFieldPosition selector for 'A' field alignment, corresponding to the UCAL_MILLISEC...
Definition: udat.h:665
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:868
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
UDateFormat
void * UDateFormat
A date formatter.
Definition: udat.h:151
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 'v' field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:680
UDAT_ERAS
The era names, for example AD.
Definition: udat.h:1362
UDAT_CYCLIC_YEARS_WIDE
Cyclic year names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols not ...
Definition: udat.h:1422
UDAT_WEEK_OF_MONTH_FIELD
FieldPosition and UFieldPosition selector for 'W' field alignment, corresponding to the UCAL_WEEK_OF_...
Definition: udat.h:597
UDAT_WEEKDAYS
The CLDR-style format "wide" weekday names, for example Monday.
Definition: udat.h:1368
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:1458
UDateFormatStyle
UDateFormatStyle
The possible date/time format styles.
Definition: udat.h:156
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:1439
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 'E' field alignment, corresponding to the UCAL_DAY_OF_W...
Definition: udat.h:569
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 'a' field alignment, corresponding to the UCAL_AM_PM fi...
Definition: udat.h:604
LocalUDateFormatPointer
"Smart pointer" class, closes a UDateFormat via udat_close().
UDAT_SHORT_QUARTERS
The short quarter names, for example Q1.
Definition: udat.h:1400
UDAT_CYCLIC_YEARS_NARROW
Cyclic year names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols not ...
Definition: udat.h:1433
UDAT_HOUR0_FIELD
FieldPosition and UFieldPosition selector for 'K' field alignment, corresponding to the UCAL_HOUR fie...
Definition: udat.h:622
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:312
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
UDisplayContextType
UDisplayContextType
Display context types, for getting values of a particular setting.
Definition: udisplaycontext.h:25
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:1402
UDateFormatField
UDateFormatField
FieldPosition and UFieldPosition selectors for format fields defined by DateFormat and UDateFormat...
Definition: udat.h:488
UDAT_ERA_FIELD
FieldPosition and UFieldPosition selector for 'G' field alignment, corresponding to the UCAL_ERA fiel...
Definition: udat.h:494
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
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:336
UDAT_MINUTE_FIELD
FieldPosition and UFieldPosition selector for 'm' field alignment, corresponding to the UCAL_MINUTE f...
Definition: udat.h:540
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:1394
UDAT_NARROW_MONTHS
The narrow month names, for example F.
Definition: udat.h:1381
UDAT_CYCLIC_YEARS_ABBREVIATED
Cyclic year names (only supported for some calendars, and only for FORMAT usage)
Definition: udat.h:1427
UDAT_TIMEZONE_ISO_LOCAL_FIELD
FieldPosition selector for 'x' field alignment, corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OF...
Definition: udat.h:753
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 's' field alignment, corresponding to the UCAL_SECOND f...
Definition: udat.h:547
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:1373
UDAT_TIMEZONE_FIELD
FieldPosition and UFieldPosition selector for 'z' field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:630
UDAT_YEAR_FIELD
FieldPosition and UFieldPosition selector for 'y' field alignment, corresponding to the UCAL_YEAR fie...
Definition: udat.h:501
UDAT_STANDALONE_MONTH_FIELD
FieldPosition selector for 'L' field alignment, corresponding to the UCAL_MONTH field.
Definition: udat.h:695
UDAT_AM_PMS
The AM/PM names, for example AM.
Definition: udat.h:1375
UDAT_FIELD_COUNT
Number of FieldPosition and UFieldPosition selectors for DateFormat and UDateFormat.
Definition: udat.h:782
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 'Z' field alignment, corresponding to the UCAL_ZONE_OFF...
Definition: udat.h:673
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:111
UDAT_HOUR_OF_DAY0_FIELD
FieldPosition and UFieldPosition selector for 'H' field alignment, corresponding to the UCAL_HOUR_OF_...
Definition: udat.h:533
UDateFormatBooleanAttribute
UDateFormatBooleanAttribute
DateFormat boolean attributes.
Definition: udat.h:863
UDAT_FRACTIONAL_SECOND_FIELD
FieldPosition and UFieldPosition selector for 'S' field alignment, corresponding to the UCAL_MILLISEC...
Definition: udat.h:562
UDAT_HOUR1_FIELD
FieldPosition and UFieldPosition selector for 'h' field alignment, corresponding to the UCAL_HOUR fie...
Definition: udat.h:613
UDAT_ZODIAC_NAMES_ABBREVIATED
Calendar zodiac names (only supported for some calendars, and only for FORMAT usage) ...
Definition: udat.h:1444
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:729
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:109
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:234
unum.h
C API: NumberFormat.
UDAT_MEDIUM
Medium style.
Definition: udat.h:162
UDAT_STANDALONE_SHORTER_WEEKDAYS
Standalone version of UDAT_SHORTER_WEEKDAYS.
Definition: udat.h:1416