ICU 70.1 70.1

ucal.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-2015, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 *******************************************************************************
8 */
9
10#ifndef UCAL_H
11#define UCAL_H
12
13#include "unicode/utypes.h"
14#include "unicode/uenum.h"
15#include "unicode/uloc.h"
16
17#if U_SHOW_CPLUSPLUS_API
18#include "unicode/localpointer.h"
19#endif // U_SHOW_CPLUSPLUS_API
20
21#if !UCONFIG_NO_FORMATTING
22
166#define UCAL_UNKNOWN_ZONE_ID "Etc/Unknown"
167
172 typedef void* UCalendar;
173
177 enum UCalendarType {
183 UCAL_TRADITIONAL,
188 UCAL_DEFAULT = UCAL_TRADITIONAL,
193 UCAL_GREGORIAN
194};
195
197 typedef enum UCalendarType UCalendarType;
198
202 enum UCalendarDateFields {
208 UCAL_ERA,
209
214 UCAL_YEAR,
215
235 UCAL_MONTH,
236
248 UCAL_WEEK_OF_YEAR,
249
263 UCAL_WEEK_OF_MONTH,
264
272 UCAL_DATE,
273
279 UCAL_DAY_OF_YEAR,
280
295 UCAL_DAY_OF_WEEK,
296
320 UCAL_DAY_OF_WEEK_IN_MONTH,
321
331 UCAL_AM_PM,
332
342 UCAL_HOUR,
343
351 UCAL_HOUR_OF_DAY,
352
359 UCAL_MINUTE,
360
367 UCAL_SECOND,
368
375 UCAL_MILLISECOND,
376
382 UCAL_ZONE_OFFSET,
383
389 UCAL_DST_OFFSET,
390
398 UCAL_YEAR_WOY,
399
406 UCAL_DOW_LOCAL,
407
414 UCAL_EXTENDED_YEAR,
415
426 UCAL_JULIAN_DAY,
427
437 UCAL_MILLISECONDS_IN_DAY,
438
443 UCAL_IS_LEAP_MONTH,
444
445 /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
446 * it is needed for layout of Calendar, DateFormat, and other objects */
447#ifndef U_FORCE_HIDE_DEPRECATED_API
452 UCAL_FIELD_COUNT,
453#endif // U_FORCE_HIDE_DEPRECATED_API
454
463 UCAL_DAY_OF_MONTH=UCAL_DATE
464};
465
467 typedef enum UCalendarDateFields UCalendarDateFields;
476 enum UCalendarDaysOfWeek {
478 UCAL_SUNDAY = 1,
480 UCAL_MONDAY,
482 UCAL_TUESDAY,
484 UCAL_WEDNESDAY,
486 UCAL_THURSDAY,
488 UCAL_FRIDAY,
490 UCAL_SATURDAY
491};
492
494 typedef enum UCalendarDaysOfWeek UCalendarDaysOfWeek;
495
499 enum UCalendarMonths {
501 UCAL_JANUARY,
503 UCAL_FEBRUARY,
505 UCAL_MARCH,
507 UCAL_APRIL,
509 UCAL_MAY,
511 UCAL_JUNE,
513 UCAL_JULY,
515 UCAL_AUGUST,
517 UCAL_SEPTEMBER,
519 UCAL_OCTOBER,
521 UCAL_NOVEMBER,
523 UCAL_DECEMBER,
528 UCAL_UNDECIMBER
529};
530
532 typedef enum UCalendarMonths UCalendarMonths;
533
537 enum UCalendarAMPMs {
539 UCAL_AM,
541 UCAL_PM
542};
543
545 typedef enum UCalendarAMPMs UCalendarAMPMs;
546
553 enum USystemTimeZoneType {
558 UCAL_ZONE_TYPE_ANY,
563 UCAL_ZONE_TYPE_CANONICAL,
568 UCAL_ZONE_TYPE_CANONICAL_LOCATION
569};
570
572 typedef enum USystemTimeZoneType USystemTimeZoneType;
573
590 U_CAPI UEnumeration* U_EXPORT2
591 ucal_openTimeZoneIDEnumeration(USystemTimeZoneType zoneType, const char* region,
592 const int32_t* rawOffset, UErrorCode* ec);
593
605 U_CAPI UEnumeration* U_EXPORT2
606 ucal_openTimeZones(UErrorCode* ec);
607
624 U_CAPI UEnumeration* U_EXPORT2
625 ucal_openCountryTimeZones(const char* country, UErrorCode* ec);
626
650 U_CAPI int32_t U_EXPORT2
651 ucal_getDefaultTimeZone(UChar* result, int32_t resultCapacity, UErrorCode* ec);
652
662 U_CAPI void U_EXPORT2
663 ucal_setDefaultTimeZone(const UChar* zoneID, UErrorCode* ec);
664
694 U_CAPI int32_t U_EXPORT2
695 ucal_getHostTimeZone(UChar *result, int32_t resultCapacity, UErrorCode *ec);
696
713 U_CAPI int32_t U_EXPORT2
714 ucal_getDSTSavings(const UChar* zoneID, UErrorCode* ec);
715
722 U_CAPI UDate U_EXPORT2
723 ucal_getNow(void);
724
748 U_CAPI UCalendar* U_EXPORT2
749 ucal_open(const UChar* zoneID,
750 int32_t len,
751 const char* locale,
752 UCalendarType type,
753 UErrorCode* status);
754
761 U_CAPI void U_EXPORT2
762 ucal_close(UCalendar *cal);
763
764#if U_SHOW_CPLUSPLUS_API
765
766U_NAMESPACE_BEGIN
767
777 U_DEFINE_LOCAL_OPEN_POINTER(LocalUCalendarPointer, UCalendar, ucal_close);
778
779U_NAMESPACE_END
780
781#endif
782
791 U_CAPI UCalendar* U_EXPORT2
792 ucal_clone(const UCalendar* cal,
793 UErrorCode* status);
794
804 U_CAPI void U_EXPORT2
805 ucal_setTimeZone(UCalendar* cal,
806 const UChar* zoneID,
807 int32_t len,
808 UErrorCode* status);
809
820 U_CAPI int32_t U_EXPORT2
821 ucal_getTimeZoneID(const UCalendar *cal,
822 UChar *result,
823 int32_t resultLength,
824 UErrorCode *status);
825
830 enum UCalendarDisplayNameType {
832 UCAL_STANDARD,
834 UCAL_SHORT_STANDARD,
836 UCAL_DST,
838 UCAL_SHORT_DST
839};
840
842 typedef enum UCalendarDisplayNameType UCalendarDisplayNameType;
843
857 U_CAPI int32_t U_EXPORT2
858 ucal_getTimeZoneDisplayName(const UCalendar* cal,
859 UCalendarDisplayNameType type,
860 const char* locale,
861 UChar* result,
862 int32_t resultLength,
863 UErrorCode* status);
864
873 U_CAPI UBool U_EXPORT2
874 ucal_inDaylightTime(const UCalendar* cal,
875 UErrorCode* status );
876
897 U_CAPI void U_EXPORT2
898 ucal_setGregorianChange(UCalendar *cal, UDate date, UErrorCode *pErrorCode);
899
920 U_CAPI UDate U_EXPORT2
921 ucal_getGregorianChange(const UCalendar *cal, UErrorCode *pErrorCode);
922
927 enum UCalendarAttribute {
932 UCAL_LENIENT,
937 UCAL_FIRST_DAY_OF_WEEK,
942 UCAL_MINIMAL_DAYS_IN_FIRST_WEEK,
948 UCAL_REPEATED_WALL_TIME,
954 UCAL_SKIPPED_WALL_TIME
955};
956
958 typedef enum UCalendarAttribute UCalendarAttribute;
959
965 enum UCalendarWallTimeOption {
972 UCAL_WALLTIME_LAST,
979 UCAL_WALLTIME_FIRST,
985 UCAL_WALLTIME_NEXT_VALID
986};
988 typedef enum UCalendarWallTimeOption UCalendarWallTimeOption;
989
1001 U_CAPI int32_t U_EXPORT2
1002 ucal_getAttribute(const UCalendar* cal,
1003 UCalendarAttribute attr);
1004
1016 U_CAPI void U_EXPORT2
1017 ucal_setAttribute(UCalendar* cal,
1018 UCalendarAttribute attr,
1019 int32_t newValue);
1020
1030 U_CAPI const char* U_EXPORT2
1031 ucal_getAvailable(int32_t localeIndex);
1032
1041 U_CAPI int32_t U_EXPORT2
1042 ucal_countAvailable(void);
1043
1055 U_CAPI UDate U_EXPORT2
1056 ucal_getMillis(const UCalendar* cal,
1057 UErrorCode* status);
1058
1070 U_CAPI void U_EXPORT2
1071 ucal_setMillis(UCalendar* cal,
1072 UDate dateTime,
1073 UErrorCode* status );
1074
1089 U_CAPI void U_EXPORT2
1090 ucal_setDate(UCalendar* cal,
1091 int32_t year,
1092 int32_t month,
1093 int32_t date,
1094 UErrorCode* status);
1095
1113 U_CAPI void U_EXPORT2
1114 ucal_setDateTime(UCalendar* cal,
1115 int32_t year,
1116 int32_t month,
1117 int32_t date,
1118 int32_t hour,
1119 int32_t minute,
1120 int32_t second,
1121 UErrorCode* status);
1122
1132 U_CAPI UBool U_EXPORT2
1133 ucal_equivalentTo(const UCalendar* cal1,
1134 const UCalendar* cal2);
1135
1154 U_CAPI void U_EXPORT2
1155 ucal_add(UCalendar* cal,
1156 UCalendarDateFields field,
1157 int32_t amount,
1158 UErrorCode* status);
1159
1184 U_CAPI void U_EXPORT2
1185 ucal_roll(UCalendar* cal,
1186 UCalendarDateFields field,
1187 int32_t amount,
1188 UErrorCode* status);
1189
1206 U_CAPI int32_t U_EXPORT2
1207 ucal_get(const UCalendar* cal,
1208 UCalendarDateFields field,
1209 UErrorCode* status );
1210
1226 U_CAPI void U_EXPORT2
1227 ucal_set(UCalendar* cal,
1228 UCalendarDateFields field,
1229 int32_t value);
1230
1246 U_CAPI UBool U_EXPORT2
1247 ucal_isSet(const UCalendar* cal,
1248 UCalendarDateFields field);
1249
1264 U_CAPI void U_EXPORT2
1265 ucal_clearField(UCalendar* cal,
1266 UCalendarDateFields field);
1267
1278 U_CAPI void U_EXPORT2
1279 ucal_clear(UCalendar* calendar);
1280
1285 enum UCalendarLimitType {
1287 UCAL_MINIMUM,
1289 UCAL_MAXIMUM,
1291 UCAL_GREATEST_MINIMUM,
1293 UCAL_LEAST_MAXIMUM,
1295 UCAL_ACTUAL_MINIMUM,
1297 UCAL_ACTUAL_MAXIMUM
1298};
1299
1301 typedef enum UCalendarLimitType UCalendarLimitType;
1302
1317 U_CAPI int32_t U_EXPORT2
1318 ucal_getLimit(const UCalendar* cal,
1319 UCalendarDateFields field,
1320 UCalendarLimitType type,
1321 UErrorCode* status);
1322
1330 U_CAPI const char * U_EXPORT2
1331 ucal_getLocaleByType(const UCalendar *cal, ULocDataLocaleType type, UErrorCode* status);
1332
1339 U_CAPI const char * U_EXPORT2
1340 ucal_getTZDataVersion(UErrorCode* status);
1341
1360 U_CAPI int32_t U_EXPORT2
1361 ucal_getCanonicalTimeZoneID(const UChar* id, int32_t len,
1362 UChar* result, int32_t resultCapacity, UBool *isSystemID, UErrorCode* status);
1370 U_CAPI const char * U_EXPORT2
1371 ucal_getType(const UCalendar *cal, UErrorCode* status);
1372
1389 U_CAPI UEnumeration* U_EXPORT2
1390 ucal_getKeywordValuesForLocale(const char* key,
1391 const char* locale,
1392 UBool commonlyUsed,
1393 UErrorCode* status);
1394
1395
1399 enum UCalendarWeekdayType {
1404 UCAL_WEEKDAY,
1409 UCAL_WEEKEND,
1415 UCAL_WEEKEND_ONSET,
1421 UCAL_WEEKEND_CEASE
1422};
1423
1425 typedef enum UCalendarWeekdayType UCalendarWeekdayType;
1426
1444 U_CAPI UCalendarWeekdayType U_EXPORT2
1445 ucal_getDayOfWeekType(const UCalendar *cal, UCalendarDaysOfWeek dayOfWeek, UErrorCode* status);
1446
1462 U_CAPI int32_t U_EXPORT2
1463 ucal_getWeekendTransition(const UCalendar *cal, UCalendarDaysOfWeek dayOfWeek, UErrorCode *status);
1464
1475 U_CAPI UBool U_EXPORT2
1476 ucal_isWeekend(const UCalendar *cal, UDate date, UErrorCode *status);
1477
1502 U_CAPI int32_t U_EXPORT2
1503 ucal_getFieldDifference(UCalendar* cal,
1504 UDate target,
1505 UCalendarDateFields field,
1506 UErrorCode* status);
1507
1512 enum UTimeZoneTransitionType {
1518 UCAL_TZ_TRANSITION_NEXT,
1524 UCAL_TZ_TRANSITION_NEXT_INCLUSIVE,
1530 UCAL_TZ_TRANSITION_PREVIOUS,
1536 UCAL_TZ_TRANSITION_PREVIOUS_INCLUSIVE
1537};
1538
1539 typedef enum UTimeZoneTransitionType UTimeZoneTransitionType;
1556 U_CAPI UBool U_EXPORT2
1557 ucal_getTimeZoneTransitionDate(const UCalendar* cal, UTimeZoneTransitionType type,
1558 UDate* transition, UErrorCode* status);
1559
1584 U_CAPI int32_t U_EXPORT2
1585 ucal_getWindowsTimeZoneID(const UChar* id, int32_t len,
1586 UChar* winid, int32_t winidCapacity, UErrorCode* status);
1587
1616 U_CAPI int32_t U_EXPORT2
1617 ucal_getTimeZoneIDForWindowsID(const UChar* winid, int32_t len, const char* region,
1618 UChar* id, int32_t idCapacity, UErrorCode* status);
1619
1620#ifndef U_FORCE_HIDE_DRAFT_API
1627 enum UTimeZoneLocalOption {
1628#ifndef U_HIDE_DRAFT_API
1634 UCAL_TZ_LOCAL_FORMER = 0x04,
1640 UCAL_TZ_LOCAL_LATTER = 0x0C,
1649 UCAL_TZ_LOCAL_STANDARD_FORMER = UCAL_TZ_LOCAL_FORMER | 0x01,
1658 UCAL_TZ_LOCAL_STANDARD_LATTER = UCAL_TZ_LOCAL_LATTER | 0x01,
1667 UCAL_TZ_LOCAL_DAYLIGHT_FORMER = UCAL_TZ_LOCAL_FORMER | 0x03,
1676 UCAL_TZ_LOCAL_DAYLIGHT_LATTER = UCAL_TZ_LOCAL_LATTER | 0x03,
1677#else /* U_HIDE_DRAFT_API */
1683 UCAL_TZ_LOCAL_NONE = 0,
1684#endif /* U_HIDE_DRAFT_API */
1685};
1686 typedef enum UTimeZoneLocalOption UTimeZoneLocalOption;
1715 U_CAPI void U_EXPORT2
1716 ucal_getTimeZoneOffsetFromLocal(
1717 const UCalendar* cal,
1718 UTimeZoneLocalOption nonExistingTimeOpt,
1719 UTimeZoneLocalOption duplicatedTimeOpt,
1720 int32_t* rawOffset, int32_t* dstOffset, UErrorCode* status);
1721#endif /* U_FORCE_HIDE_DRAFT_API */
1722
1723#endif /* #if !UCONFIG_NO_FORMATTING */
1724
1725#endif
LocalUCalendarPointer
"Smart pointer" class, closes a UCalendar via ucal_close().
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
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:550
UCalendarDateFields
UCalendarDateFields
Possible fields in a UCalendar.
Definition: ucal.h:202
UCAL_HOUR_OF_DAY
@ UCAL_HOUR_OF_DAY
Field number indicating the hour of the day.
Definition: ucal.h:351
UCAL_EXTENDED_YEAR
@ UCAL_EXTENDED_YEAR
Year of this calendar system, encompassing all supra-year fields.
Definition: ucal.h:414
UCAL_ERA
@ UCAL_ERA
Field number indicating the era, e.g., AD or BC in the Gregorian (Julian) calendar.
Definition: ucal.h:208
UCAL_WEEK_OF_MONTH
@ UCAL_WEEK_OF_MONTH
Field number indicating the week number within the current month.
Definition: ucal.h:263
UCAL_YEAR
@ UCAL_YEAR
Field number indicating the year.
Definition: ucal.h:214
UCAL_DAY_OF_YEAR
@ UCAL_DAY_OF_YEAR
Field number indicating the day number within the current year.
Definition: ucal.h:279
UCAL_YEAR_WOY
@ UCAL_YEAR_WOY
Field number indicating the extended year corresponding to the UCAL_WEEK_OF_YEAR field.
Definition: ucal.h:398
UCAL_MINUTE
@ UCAL_MINUTE
Field number indicating the minute within the hour.
Definition: ucal.h:359
UCAL_JULIAN_DAY
@ UCAL_JULIAN_DAY
Field number indicating the modified Julian day number.
Definition: ucal.h:426
UCAL_DATE
@ UCAL_DATE
Field number indicating the day of the month.
Definition: ucal.h:272
UCAL_SECOND
@ UCAL_SECOND
Field number indicating the second within the minute.
Definition: ucal.h:367
UCAL_DAY_OF_WEEK_IN_MONTH
@ UCAL_DAY_OF_WEEK_IN_MONTH
Field number indicating the ordinal number of the day of the week within the current month.
Definition: ucal.h:320
UCAL_MONTH
@ UCAL_MONTH
Field number indicating the month.
Definition: ucal.h:235
UCAL_ZONE_OFFSET
@ UCAL_ZONE_OFFSET
Field number indicating the raw offset from GMT in milliseconds.
Definition: ucal.h:382
UCAL_WEEK_OF_YEAR
@ UCAL_WEEK_OF_YEAR
Field number indicating the week number within the current year.
Definition: ucal.h:248
UCAL_MILLISECOND
@ UCAL_MILLISECOND
Field number indicating the millisecond within the second.
Definition: ucal.h:375
UCAL_HOUR
@ UCAL_HOUR
Field number indicating the hour of the morning or afternoon.
Definition: ucal.h:342
UCAL_DAY_OF_MONTH
@ UCAL_DAY_OF_MONTH
Field number indicating the day of the month.
Definition: ucal.h:463
UCAL_DAY_OF_WEEK
@ UCAL_DAY_OF_WEEK
Field number indicating the day of the week.
Definition: ucal.h:295
UCAL_AM_PM
@ UCAL_AM_PM
Field number indicating whether the HOUR is before or after noon.
Definition: ucal.h:331
UCAL_FIELD_COUNT
@ UCAL_FIELD_COUNT
One more than the highest normal UCalendarDateFields value.
Definition: ucal.h:452
UCAL_IS_LEAP_MONTH
@ UCAL_IS_LEAP_MONTH
Whether or not the current month is a leap month (0 or 1).
Definition: ucal.h:443
UCAL_DST_OFFSET
@ UCAL_DST_OFFSET
Field number indicating the daylight savings offset in milliseconds.
Definition: ucal.h:389
UCAL_MILLISECONDS_IN_DAY
@ UCAL_MILLISECONDS_IN_DAY
Ranges from 0 to 23:59:59.999 (regardless of DST).
Definition: ucal.h:437
UCAL_DOW_LOCAL
@ UCAL_DOW_LOCAL
Field number indicating the localized day of week.
Definition: ucal.h:406
ucal_getTimeZoneDisplayName
U_CAPI int32_t ucal_getTimeZoneDisplayName(const UCalendar *cal, UCalendarDisplayNameType type, const char *locale, UChar *result, int32_t resultLength, UErrorCode *status)
Get the display name for a UCalendar's TimeZone.
UTimeZoneLocalOption
UTimeZoneLocalOption
Options used by ucal_getTimeZoneOffsetFromLocal and BasicTimeZone::getOffsetFromLocal() to specify ho...
Definition: ucal.h:1627
UCAL_TZ_LOCAL_DAYLIGHT_LATTER
@ UCAL_TZ_LOCAL_DAYLIGHT_LATTER
An input time is interpreted as daylight saving time when local time is switched to/from standard tim...
Definition: ucal.h:1676
UCAL_TZ_LOCAL_STANDARD_LATTER
@ UCAL_TZ_LOCAL_STANDARD_LATTER
An input time is interpreted as standard time when local time is switched to/from daylight saving tim...
Definition: ucal.h:1658
UCAL_TZ_LOCAL_STANDARD_FORMER
@ UCAL_TZ_LOCAL_STANDARD_FORMER
An input time is interpreted as standard time when local time is switched to/from daylight saving tim...
Definition: ucal.h:1649
UCAL_TZ_LOCAL_DAYLIGHT_FORMER
@ UCAL_TZ_LOCAL_DAYLIGHT_FORMER
An input time is interpreted as daylight saving time when local time is switched to/from standard tim...
Definition: ucal.h:1667
UCAL_TZ_LOCAL_LATTER
@ UCAL_TZ_LOCAL_LATTER
An input time is always interpreted as local time after a time zone transition.
Definition: ucal.h:1640
UCAL_TZ_LOCAL_FORMER
@ UCAL_TZ_LOCAL_FORMER
An input time is always interpreted as local time before a time zone transition.
Definition: ucal.h:1634
ucal_getGregorianChange
U_CAPI UDate ucal_getGregorianChange(const UCalendar *cal, UErrorCode *pErrorCode)
Gets the Gregorian Calendar change date.
USystemTimeZoneType
USystemTimeZoneType
System time zone type constants used by filtering zones in ucal_openTimeZoneIDEnumeration.
Definition: ucal.h:553
UCAL_ZONE_TYPE_CANONICAL
@ UCAL_ZONE_TYPE_CANONICAL
Canonical system zones.
Definition: ucal.h:563
UCAL_ZONE_TYPE_ANY
@ UCAL_ZONE_TYPE_ANY
Any system zones.
Definition: ucal.h:558
UCAL_ZONE_TYPE_CANONICAL_LOCATION
@ UCAL_ZONE_TYPE_CANONICAL_LOCATION
Canonical system zones associated with actual locations.
Definition: ucal.h:568
ucal_getWeekendTransition
U_CAPI int32_t ucal_getWeekendTransition(const UCalendar *cal, UCalendarDaysOfWeek dayOfWeek, UErrorCode *status)
Returns the time during the day at which the weekend begins or ends in this calendar system.
UCalendarAttribute
UCalendarAttribute
Types of UCalendar attributes.
Definition: ucal.h:927
UCAL_MINIMAL_DAYS_IN_FIRST_WEEK
@ UCAL_MINIMAL_DAYS_IN_FIRST_WEEK
Minimum number of days in first week.
Definition: ucal.h:942
UCAL_REPEATED_WALL_TIME
@ UCAL_REPEATED_WALL_TIME
The behavior for handling wall time repeating multiple times at negative time zone offset transitions...
Definition: ucal.h:948
UCAL_FIRST_DAY_OF_WEEK
@ UCAL_FIRST_DAY_OF_WEEK
First day of week.
Definition: ucal.h:937
UCAL_SKIPPED_WALL_TIME
@ UCAL_SKIPPED_WALL_TIME
The behavior for handling skipped wall time at positive time zone offset transitions.
Definition: ucal.h:954
UCAL_LENIENT
@ UCAL_LENIENT
Lenient parsing.
Definition: ucal.h:932
ucal_setDate
U_CAPI void ucal_setDate(UCalendar *cal, int32_t year, int32_t month, int32_t date, UErrorCode *status)
Set a UCalendar's current date.
ucal_setGregorianChange
U_CAPI void ucal_setGregorianChange(UCalendar *cal, UDate date, UErrorCode *pErrorCode)
Sets the GregorianCalendar change date.
ucal_getKeywordValuesForLocale
U_CAPI UEnumeration * ucal_getKeywordValuesForLocale(const char *key, const char *locale, UBool commonlyUsed, UErrorCode *status)
Given a key and a locale, returns an array of string values in a preferred order that would make a di...
ucal_getTZDataVersion
U_CAPI const char * ucal_getTZDataVersion(UErrorCode *status)
Returns the timezone data version currently used by ICU.
ucal_isWeekend
U_CAPI UBool ucal_isWeekend(const UCalendar *cal, UDate date, UErrorCode *status)
Returns true if the given UDate is in the weekend in this calendar system.
ucal_close
U_CAPI void ucal_close(UCalendar *cal)
Close a UCalendar.
UCalendarWallTimeOption
UCalendarWallTimeOption
Options for handling ambiguous wall time at time zone offset transitions.
Definition: ucal.h:965
UCAL_WALLTIME_NEXT_VALID
@ UCAL_WALLTIME_NEXT_VALID
An ambiguous wall time to be interpreted as the next valid wall time.
Definition: ucal.h:985
UCAL_WALLTIME_LAST
@ UCAL_WALLTIME_LAST
An ambiguous wall time to be interpreted as the latest.
Definition: ucal.h:972
UCAL_WALLTIME_FIRST
@ UCAL_WALLTIME_FIRST
An ambiguous wall time to be interpreted as the earliest.
Definition: ucal.h:979
ucal_clearField
U_CAPI void ucal_clearField(UCalendar *cal, UCalendarDateFields field)
Clear a field in a UCalendar.
ucal_getLocaleByType
U_CAPI const char * ucal_getLocaleByType(const UCalendar *cal, ULocDataLocaleType type, UErrorCode *status)
Get the locale for this calendar object.
ucal_getLimit
U_CAPI int32_t ucal_getLimit(const UCalendar *cal, UCalendarDateFields field, UCalendarLimitType type, UErrorCode *status)
Determine a limit for a field in a UCalendar.
ucal_inDaylightTime
U_CAPI UBool ucal_inDaylightTime(const UCalendar *cal, UErrorCode *status)
Determine if a UCalendar is currently in daylight savings time.
UCalendarWeekdayType
UCalendarWeekdayType
Weekday types, as returned by ucal_getDayOfWeekType().
Definition: ucal.h:1399
UCAL_WEEKDAY
@ UCAL_WEEKDAY
Designates a full weekday (no part of the day is included in the weekend).
Definition: ucal.h:1404
UCAL_WEEKEND_CEASE
@ UCAL_WEEKEND_CEASE
Designates a day that starts as the weekend and transitions to a weekday.
Definition: ucal.h:1421
UCAL_WEEKEND
@ UCAL_WEEKEND
Designates a full weekend day (the entire day is included in the weekend).
Definition: ucal.h:1409
UCAL_WEEKEND_ONSET
@ UCAL_WEEKEND_ONSET
Designates a day that starts as a weekday and transitions to the weekend.
Definition: ucal.h:1415
ucal_getDayOfWeekType
U_CAPI UCalendarWeekdayType ucal_getDayOfWeekType(const UCalendar *cal, UCalendarDaysOfWeek dayOfWeek, UErrorCode *status)
Returns whether the given day of the week is a weekday, a weekend day, or a day that transitions from...
ucal_set
U_CAPI void ucal_set(UCalendar *cal, UCalendarDateFields field, int32_t value)
Set the value of a field in a UCalendar.
UCalendarDaysOfWeek
UCalendarDaysOfWeek
Useful constant for days of week.
Definition: ucal.h:476
UCAL_WEDNESDAY
@ UCAL_WEDNESDAY
Wednesday.
Definition: ucal.h:484
UCAL_SATURDAY
@ UCAL_SATURDAY
Saturday.
Definition: ucal.h:490
UCAL_THURSDAY
@ UCAL_THURSDAY
Thursday.
Definition: ucal.h:486
UCAL_MONDAY
@ UCAL_MONDAY
Monday.
Definition: ucal.h:480
UCAL_SUNDAY
@ UCAL_SUNDAY
Sunday.
Definition: ucal.h:478
UCAL_FRIDAY
@ UCAL_FRIDAY
Friday.
Definition: ucal.h:488
UCAL_TUESDAY
@ UCAL_TUESDAY
Tuesday.
Definition: ucal.h:482
ucal_getAttribute
U_CAPI int32_t ucal_getAttribute(const UCalendar *cal, UCalendarAttribute attr)
Get a numeric attribute associated with a UCalendar.
ucal_get
U_CAPI int32_t ucal_get(const UCalendar *cal, UCalendarDateFields field, UErrorCode *status)
Get the current value of a field from a UCalendar.
ucal_getType
U_CAPI const char * ucal_getType(const UCalendar *cal, UErrorCode *status)
Get the resource keyword value string designating the calendar type for the UCalendar.
ucal_add
U_CAPI void ucal_add(UCalendar *cal, UCalendarDateFields field, int32_t amount, UErrorCode *status)
Add a specified signed amount to a particular field in a UCalendar.
ucal_open
U_CAPI UCalendar * ucal_open(const UChar *zoneID, int32_t len, const char *locale, UCalendarType type, UErrorCode *status)
Open a UCalendar.
UCalendarLimitType
UCalendarLimitType
Possible limit values for a UCalendar.
Definition: ucal.h:1285
UCAL_ACTUAL_MAXIMUM
@ UCAL_ACTUAL_MAXIMUM
Actual maximum value.
Definition: ucal.h:1297
UCAL_ACTUAL_MINIMUM
@ UCAL_ACTUAL_MINIMUM
Actual minimum value.
Definition: ucal.h:1295
UCAL_GREATEST_MINIMUM
@ UCAL_GREATEST_MINIMUM
Greatest minimum value.
Definition: ucal.h:1291
UCAL_MINIMUM
@ UCAL_MINIMUM
Minimum value.
Definition: ucal.h:1287
UCAL_MAXIMUM
@ UCAL_MAXIMUM
Maximum value.
Definition: ucal.h:1289
UCAL_LEAST_MAXIMUM
@ UCAL_LEAST_MAXIMUM
Least maximum value.
Definition: ucal.h:1293
UCalendarAMPMs
UCalendarAMPMs
Possible AM/PM values in a UCalendar.
Definition: ucal.h:537
UCAL_AM
@ UCAL_AM
AM.
Definition: ucal.h:539
UCAL_PM
@ UCAL_PM
PM.
Definition: ucal.h:541
ucal_openTimeZones
U_CAPI UEnumeration * ucal_openTimeZones(UErrorCode *ec)
Create an enumeration over all time zones.
ucal_getTimeZoneTransitionDate
U_CAPI UBool ucal_getTimeZoneTransitionDate(const UCalendar *cal, UTimeZoneTransitionType type, UDate *transition, UErrorCode *status)
Get the UDate for the next/previous time zone transition relative to the calendar's current date,...
UTimeZoneTransitionType
UTimeZoneTransitionType
Time zone transition types for ucal_getTimeZoneTransitionDate.
Definition: ucal.h:1512
UCAL_TZ_TRANSITION_PREVIOUS
@ UCAL_TZ_TRANSITION_PREVIOUS
Get the previous transition before the current date, i.e.
Definition: ucal.h:1530
UCAL_TZ_TRANSITION_PREVIOUS_INCLUSIVE
@ UCAL_TZ_TRANSITION_PREVIOUS_INCLUSIVE
Get the previous transition on or before the current date, i.e.
Definition: ucal.h:1536
UCAL_TZ_TRANSITION_NEXT
@ UCAL_TZ_TRANSITION_NEXT
Get the next transition after the current date, i.e.
Definition: ucal.h:1518
UCAL_TZ_TRANSITION_NEXT_INCLUSIVE
@ UCAL_TZ_TRANSITION_NEXT_INCLUSIVE
Get the next transition on or after the current date, i.e.
Definition: ucal.h:1524
UCalendarType
UCalendarType
Possible types of UCalendars.
Definition: ucal.h:177
UCAL_GREGORIAN
@ UCAL_GREGORIAN
Unambiguously designates the Gregorian calendar for the locale.
Definition: ucal.h:193
UCAL_DEFAULT
@ UCAL_DEFAULT
A better name for UCAL_TRADITIONAL.
Definition: ucal.h:188
UCAL_TRADITIONAL
@ UCAL_TRADITIONAL
Despite the name, UCAL_TRADITIONAL designates the locale's default calendar, which may be the Gregori...
Definition: ucal.h:183
ucal_clear
U_CAPI void ucal_clear(UCalendar *calendar)
Clear all fields in a UCalendar.
ucal_setTimeZone
U_CAPI void ucal_setTimeZone(UCalendar *cal, const UChar *zoneID, int32_t len, UErrorCode *status)
Set the TimeZone used by a UCalendar.
ucal_getDSTSavings
U_CAPI int32_t ucal_getDSTSavings(const UChar *zoneID, UErrorCode *ec)
Return the amount of time in milliseconds that the clock is advanced during daylight savings time for...
ucal_getTimeZoneOffsetFromLocal
U_CAPI void ucal_getTimeZoneOffsetFromLocal(const UCalendar *cal, UTimeZoneLocalOption nonExistingTimeOpt, UTimeZoneLocalOption duplicatedTimeOpt, int32_t *rawOffset, int32_t *dstOffset, UErrorCode *status)
Returns the time zone raw and GMT offset for the given moment in time.
ucal_setDefaultTimeZone
U_CAPI void ucal_setDefaultTimeZone(const UChar *zoneID, UErrorCode *ec)
Set the default time zone.
ucal_getTimeZoneID
U_CAPI int32_t ucal_getTimeZoneID(const UCalendar *cal, UChar *result, int32_t resultLength, UErrorCode *status)
Get the ID of the UCalendar's time zone.
ucal_getHostTimeZone
U_CAPI int32_t ucal_getHostTimeZone(UChar *result, int32_t resultCapacity, UErrorCode *ec)
Return the current host time zone.
ucal_getAvailable
U_CAPI const char * ucal_getAvailable(int32_t localeIndex)
Get a locale for which calendars are available.
ucal_getDefaultTimeZone
U_CAPI int32_t ucal_getDefaultTimeZone(UChar *result, int32_t resultCapacity, UErrorCode *ec)
Return the default time zone.
ucal_clone
U_CAPI UCalendar * ucal_clone(const UCalendar *cal, UErrorCode *status)
Open a copy of a UCalendar.
ucal_getNow
U_CAPI UDate ucal_getNow(void)
Get the current date and time.
ucal_equivalentTo
U_CAPI UBool ucal_equivalentTo(const UCalendar *cal1, const UCalendar *cal2)
Returns true if two UCalendars are equivalent.
ucal_getCanonicalTimeZoneID
U_CAPI int32_t ucal_getCanonicalTimeZoneID(const UChar *id, int32_t len, UChar *result, int32_t resultCapacity, UBool *isSystemID, UErrorCode *status)
Returns the canonical system timezone ID or the normalized custom time zone ID for the given time zon...
ucal_getTimeZoneIDForWindowsID
U_CAPI int32_t ucal_getTimeZoneIDForWindowsID(const UChar *winid, int32_t len, const char *region, UChar *id, int32_t idCapacity, UErrorCode *status)
Converts a Windows time zone ID to an equivalent system time zone ID for a region.
ucal_getFieldDifference
U_CAPI int32_t ucal_getFieldDifference(UCalendar *cal, UDate target, UCalendarDateFields field, UErrorCode *status)
Return the difference between the target time and the time this calendar object is currently set to.
ucal_setMillis
U_CAPI void ucal_setMillis(UCalendar *cal, UDate dateTime, UErrorCode *status)
Set a UCalendar's current time in millis.
ucal_roll
U_CAPI void ucal_roll(UCalendar *cal, UCalendarDateFields field, int32_t amount, UErrorCode *status)
Add a specified signed amount to a particular field in a UCalendar.
ucal_getWindowsTimeZoneID
U_CAPI int32_t ucal_getWindowsTimeZoneID(const UChar *id, int32_t len, UChar *winid, int32_t winidCapacity, UErrorCode *status)
Converts a system time zone ID to an equivalent Windows time zone ID.
ucal_openCountryTimeZones
U_CAPI UEnumeration * ucal_openCountryTimeZones(const char *country, UErrorCode *ec)
Create an enumeration over all time zones associated with the given country.
ucal_getMillis
U_CAPI UDate ucal_getMillis(const UCalendar *cal, UErrorCode *status)
Get a UCalendar's current time in millis.
ucal_setAttribute
U_CAPI void ucal_setAttribute(UCalendar *cal, UCalendarAttribute attr, int32_t newValue)
Set a numeric attribute associated with a UCalendar.
UCalendarDisplayNameType
UCalendarDisplayNameType
Possible formats for a UCalendar's display name.
Definition: ucal.h:830
UCAL_STANDARD
@ UCAL_STANDARD
Standard display name.
Definition: ucal.h:832
UCAL_SHORT_DST
@ UCAL_SHORT_DST
Short daylight savings display name.
Definition: ucal.h:838
UCAL_SHORT_STANDARD
@ UCAL_SHORT_STANDARD
Short standard display name.
Definition: ucal.h:834
UCAL_DST
@ UCAL_DST
Daylight savings display name.
Definition: ucal.h:836
ucal_openTimeZoneIDEnumeration
U_CAPI UEnumeration * ucal_openTimeZoneIDEnumeration(USystemTimeZoneType zoneType, const char *region, const int32_t *rawOffset, UErrorCode *ec)
Create an enumeration over system time zone IDs with the given filter conditions.
UCalendarMonths
UCalendarMonths
Possible months in a UCalendar.
Definition: ucal.h:499
UCAL_DECEMBER
@ UCAL_DECEMBER
December.
Definition: ucal.h:523
UCAL_MAY
@ UCAL_MAY
May.
Definition: ucal.h:509
UCAL_UNDECIMBER
@ UCAL_UNDECIMBER
Value of the UCAL_MONTH field indicating the thirteenth month of the year.
Definition: ucal.h:528
UCAL_APRIL
@ UCAL_APRIL
April.
Definition: ucal.h:507
UCAL_NOVEMBER
@ UCAL_NOVEMBER
November.
Definition: ucal.h:521
UCAL_JUNE
@ UCAL_JUNE
June.
Definition: ucal.h:511
UCAL_AUGUST
@ UCAL_AUGUST
August.
Definition: ucal.h:515
UCAL_JULY
@ UCAL_JULY
July.
Definition: ucal.h:513
UCAL_SEPTEMBER
@ UCAL_SEPTEMBER
September.
Definition: ucal.h:517
UCAL_JANUARY
@ UCAL_JANUARY
January.
Definition: ucal.h:501
UCAL_FEBRUARY
@ UCAL_FEBRUARY
February.
Definition: ucal.h:503
UCAL_MARCH
@ UCAL_MARCH
March.
Definition: ucal.h:505
UCAL_OCTOBER
@ UCAL_OCTOBER
October.
Definition: ucal.h:519
ucal_isSet
U_CAPI UBool ucal_isSet(const UCalendar *cal, UCalendarDateFields field)
Determine if a field in a UCalendar is set.
ucal_setDateTime
U_CAPI void ucal_setDateTime(UCalendar *cal, int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second, UErrorCode *status)
Set a UCalendar's current date.
UCalendar
void * UCalendar
A calendar.
Definition: ucal.h:172
ucal_countAvailable
U_CAPI int32_t ucal_countAvailable(void)
Determine how many locales have calendars available.
uenum.h
C API: String Enumeration.
UEnumeration
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition: uenum.h:44
uloc.h
C API: Locale.
ULocDataLocaleType
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested,...
Definition: uloc.h:338
UBool
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition: umachine.h:269
U_CAPI
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition: umachine.h:110
UChar
char16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:418
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
UDate
double UDate
Date and Time data type.
Definition: utypes.h:203