ICU 64.2 64.2

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 #include "unicode/localpointer.h"
17
18 #if !UCONFIG_NO_FORMATTING
19
163 #define UCAL_UNKNOWN_ZONE_ID "Etc/Unknown"
164
169 typedef void* UCalendar;
170
174 enum UCalendarType {
180 UCAL_TRADITIONAL,
185 UCAL_DEFAULT = UCAL_TRADITIONAL,
190 UCAL_GREGORIAN
191 };
192
194 typedef enum UCalendarType UCalendarType;
195
199 enum UCalendarDateFields {
205 UCAL_ERA,
206
211 UCAL_YEAR,
212
232 UCAL_MONTH,
233
245 UCAL_WEEK_OF_YEAR,
246
260 UCAL_WEEK_OF_MONTH,
261
269 UCAL_DATE,
270
276 UCAL_DAY_OF_YEAR,
277
292 UCAL_DAY_OF_WEEK,
293
317 UCAL_DAY_OF_WEEK_IN_MONTH,
318
328 UCAL_AM_PM,
329
339 UCAL_HOUR,
340
348 UCAL_HOUR_OF_DAY,
349
356 UCAL_MINUTE,
357
364 UCAL_SECOND,
365
372 UCAL_MILLISECOND,
373
379 UCAL_ZONE_OFFSET,
380
386 UCAL_DST_OFFSET,
387
395 UCAL_YEAR_WOY,
396
403 UCAL_DOW_LOCAL,
404
411 UCAL_EXTENDED_YEAR,
412
423 UCAL_JULIAN_DAY,
424
434 UCAL_MILLISECONDS_IN_DAY,
435
440 UCAL_IS_LEAP_MONTH,
441
442 /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
443 * it is needed for layout of Calendar, DateFormat, and other objects */
448 UCAL_FIELD_COUNT,
449
458 UCAL_DAY_OF_MONTH=UCAL_DATE
459 };
460
462 typedef enum UCalendarDateFields UCalendarDateFields;
471 enum UCalendarDaysOfWeek {
473 UCAL_SUNDAY = 1,
475 UCAL_MONDAY,
477 UCAL_TUESDAY,
479 UCAL_WEDNESDAY,
481 UCAL_THURSDAY,
483 UCAL_FRIDAY,
485 UCAL_SATURDAY
486 };
487
489 typedef enum UCalendarDaysOfWeek UCalendarDaysOfWeek;
490
494 enum UCalendarMonths {
496 UCAL_JANUARY,
498 UCAL_FEBRUARY,
500 UCAL_MARCH,
502 UCAL_APRIL,
504 UCAL_MAY,
506 UCAL_JUNE,
508 UCAL_JULY,
510 UCAL_AUGUST,
512 UCAL_SEPTEMBER,
514 UCAL_OCTOBER,
516 UCAL_NOVEMBER,
518 UCAL_DECEMBER,
523 UCAL_UNDECIMBER
524 };
525
527 typedef enum UCalendarMonths UCalendarMonths;
528
532 enum UCalendarAMPMs {
534 UCAL_AM,
536 UCAL_PM
537 };
538
540 typedef enum UCalendarAMPMs UCalendarAMPMs;
541
548 enum USystemTimeZoneType {
553 UCAL_ZONE_TYPE_ANY,
558 UCAL_ZONE_TYPE_CANONICAL,
563 UCAL_ZONE_TYPE_CANONICAL_LOCATION
564 };
565
567 typedef enum USystemTimeZoneType USystemTimeZoneType;
568
585 U_STABLE UEnumeration* U_EXPORT2
586 ucal_openTimeZoneIDEnumeration(USystemTimeZoneType zoneType, const char* region,
587 const int32_t* rawOffset, UErrorCode* ec);
588
600 U_STABLE UEnumeration* U_EXPORT2
601 ucal_openTimeZones(UErrorCode* ec);
602
619 U_STABLE UEnumeration* U_EXPORT2
620 ucal_openCountryTimeZones(const char* country, UErrorCode* ec);
621
645 U_STABLE int32_t U_EXPORT2
646 ucal_getDefaultTimeZone(UChar* result, int32_t resultCapacity, UErrorCode* ec);
647
657 U_STABLE void U_EXPORT2
658 ucal_setDefaultTimeZone(const UChar* zoneID, UErrorCode* ec);
659
676 U_STABLE int32_t U_EXPORT2
677 ucal_getDSTSavings(const UChar* zoneID, UErrorCode* ec);
678
685 U_STABLE UDate U_EXPORT2
686 ucal_getNow(void);
687
711 U_STABLE UCalendar* U_EXPORT2
712 ucal_open(const UChar* zoneID,
713 int32_t len,
714 const char* locale,
715 UCalendarType type,
716 UErrorCode* status);
717
724 U_STABLE void U_EXPORT2
725 ucal_close(UCalendar *cal);
726
727 #if U_SHOW_CPLUSPLUS_API
728
729 U_NAMESPACE_BEGIN
730
740 U_DEFINE_LOCAL_OPEN_POINTER(LocalUCalendarPointer, UCalendar, ucal_close);
741
742 U_NAMESPACE_END
743
744 #endif
745
754 U_STABLE UCalendar* U_EXPORT2
755 ucal_clone(const UCalendar* cal,
756 UErrorCode* status);
757
767 U_STABLE void U_EXPORT2
768 ucal_setTimeZone(UCalendar* cal,
769 const UChar* zoneID,
770 int32_t len,
771 UErrorCode* status);
772
783 U_STABLE int32_t U_EXPORT2
784 ucal_getTimeZoneID(const UCalendar *cal,
785 UChar *result,
786 int32_t resultLength,
787 UErrorCode *status);
788
793 enum UCalendarDisplayNameType {
795 UCAL_STANDARD,
797 UCAL_SHORT_STANDARD,
799 UCAL_DST,
801 UCAL_SHORT_DST
802 };
803
805 typedef enum UCalendarDisplayNameType UCalendarDisplayNameType;
806
820 U_STABLE int32_t U_EXPORT2
821 ucal_getTimeZoneDisplayName(const UCalendar* cal,
822 UCalendarDisplayNameType type,
823 const char* locale,
824 UChar* result,
825 int32_t resultLength,
826 UErrorCode* status);
827
836 U_STABLE UBool U_EXPORT2
837 ucal_inDaylightTime(const UCalendar* cal,
838 UErrorCode* status );
839
860 U_STABLE void U_EXPORT2
861 ucal_setGregorianChange(UCalendar *cal, UDate date, UErrorCode *pErrorCode);
862
883 U_STABLE UDate U_EXPORT2
884 ucal_getGregorianChange(const UCalendar *cal, UErrorCode *pErrorCode);
885
890 enum UCalendarAttribute {
895 UCAL_LENIENT,
900 UCAL_FIRST_DAY_OF_WEEK,
905 UCAL_MINIMAL_DAYS_IN_FIRST_WEEK,
911 UCAL_REPEATED_WALL_TIME,
917 UCAL_SKIPPED_WALL_TIME
918 };
919
921 typedef enum UCalendarAttribute UCalendarAttribute;
922
928 enum UCalendarWallTimeOption {
935 UCAL_WALLTIME_LAST,
942 UCAL_WALLTIME_FIRST,
948 UCAL_WALLTIME_NEXT_VALID
949 };
951 typedef enum UCalendarWallTimeOption UCalendarWallTimeOption;
952
964 U_STABLE int32_t U_EXPORT2
965 ucal_getAttribute(const UCalendar* cal,
966 UCalendarAttribute attr);
967
979 U_STABLE void U_EXPORT2
980 ucal_setAttribute(UCalendar* cal,
981 UCalendarAttribute attr,
982 int32_t newValue);
983
993 U_STABLE const char* U_EXPORT2
994 ucal_getAvailable(int32_t localeIndex);
995
1004 U_STABLE int32_t U_EXPORT2
1005 ucal_countAvailable(void);
1006
1018 U_STABLE UDate U_EXPORT2
1019 ucal_getMillis(const UCalendar* cal,
1020 UErrorCode* status);
1021
1033 U_STABLE void U_EXPORT2
1034 ucal_setMillis(UCalendar* cal,
1035 UDate dateTime,
1036 UErrorCode* status );
1037
1052 U_STABLE void U_EXPORT2
1053 ucal_setDate(UCalendar* cal,
1054 int32_t year,
1055 int32_t month,
1056 int32_t date,
1057 UErrorCode* status);
1058
1076 U_STABLE void U_EXPORT2
1077 ucal_setDateTime(UCalendar* cal,
1078 int32_t year,
1079 int32_t month,
1080 int32_t date,
1081 int32_t hour,
1082 int32_t minute,
1083 int32_t second,
1084 UErrorCode* status);
1085
1095 U_STABLE UBool U_EXPORT2
1096 ucal_equivalentTo(const UCalendar* cal1,
1097 const UCalendar* cal2);
1098
1117 U_STABLE void U_EXPORT2
1118 ucal_add(UCalendar* cal,
1119 UCalendarDateFields field,
1120 int32_t amount,
1121 UErrorCode* status);
1122
1147 U_STABLE void U_EXPORT2
1148 ucal_roll(UCalendar* cal,
1149 UCalendarDateFields field,
1150 int32_t amount,
1151 UErrorCode* status);
1152
1169 U_STABLE int32_t U_EXPORT2
1170 ucal_get(const UCalendar* cal,
1171 UCalendarDateFields field,
1172 UErrorCode* status );
1173
1189 U_STABLE void U_EXPORT2
1190 ucal_set(UCalendar* cal,
1191 UCalendarDateFields field,
1192 int32_t value);
1193
1209 U_STABLE UBool U_EXPORT2
1210 ucal_isSet(const UCalendar* cal,
1211 UCalendarDateFields field);
1212
1227 U_STABLE void U_EXPORT2
1228 ucal_clearField(UCalendar* cal,
1229 UCalendarDateFields field);
1230
1241 U_STABLE void U_EXPORT2
1242 ucal_clear(UCalendar* calendar);
1243
1248 enum UCalendarLimitType {
1250 UCAL_MINIMUM,
1252 UCAL_MAXIMUM,
1254 UCAL_GREATEST_MINIMUM,
1256 UCAL_LEAST_MAXIMUM,
1258 UCAL_ACTUAL_MINIMUM,
1260 UCAL_ACTUAL_MAXIMUM
1261 };
1262
1264 typedef enum UCalendarLimitType UCalendarLimitType;
1265
1280 U_STABLE int32_t U_EXPORT2
1281 ucal_getLimit(const UCalendar* cal,
1282 UCalendarDateFields field,
1283 UCalendarLimitType type,
1284 UErrorCode* status);
1285
1293 U_STABLE const char * U_EXPORT2
1294 ucal_getLocaleByType(const UCalendar *cal, ULocDataLocaleType type, UErrorCode* status);
1295
1302 U_STABLE const char * U_EXPORT2
1303 ucal_getTZDataVersion(UErrorCode* status);
1304
1323 U_STABLE int32_t U_EXPORT2
1324 ucal_getCanonicalTimeZoneID(const UChar* id, int32_t len,
1325 UChar* result, int32_t resultCapacity, UBool *isSystemID, UErrorCode* status);
1333 U_STABLE const char * U_EXPORT2
1334 ucal_getType(const UCalendar *cal, UErrorCode* status);
1335
1352 U_STABLE UEnumeration* U_EXPORT2
1353 ucal_getKeywordValuesForLocale(const char* key,
1354 const char* locale,
1355 UBool commonlyUsed,
1356 UErrorCode* status);
1357
1358
1362 enum UCalendarWeekdayType {
1367 UCAL_WEEKDAY,
1372 UCAL_WEEKEND,
1378 UCAL_WEEKEND_ONSET,
1384 UCAL_WEEKEND_CEASE
1385 };
1386
1388 typedef enum UCalendarWeekdayType UCalendarWeekdayType;
1389
1407 U_STABLE UCalendarWeekdayType U_EXPORT2
1408 ucal_getDayOfWeekType(const UCalendar *cal, UCalendarDaysOfWeek dayOfWeek, UErrorCode* status);
1409
1425 U_STABLE int32_t U_EXPORT2
1426 ucal_getWeekendTransition(const UCalendar *cal, UCalendarDaysOfWeek dayOfWeek, UErrorCode *status);
1427
1438 U_STABLE UBool U_EXPORT2
1439 ucal_isWeekend(const UCalendar *cal, UDate date, UErrorCode *status);
1440
1465 U_STABLE int32_t U_EXPORT2
1466 ucal_getFieldDifference(UCalendar* cal,
1467 UDate target,
1468 UCalendarDateFields field,
1469 UErrorCode* status);
1470
1475 enum UTimeZoneTransitionType {
1481 UCAL_TZ_TRANSITION_NEXT,
1487 UCAL_TZ_TRANSITION_NEXT_INCLUSIVE,
1493 UCAL_TZ_TRANSITION_PREVIOUS,
1499 UCAL_TZ_TRANSITION_PREVIOUS_INCLUSIVE
1500 };
1501
1502 typedef enum UTimeZoneTransitionType UTimeZoneTransitionType;
1519 U_STABLE UBool U_EXPORT2
1520 ucal_getTimeZoneTransitionDate(const UCalendar* cal, UTimeZoneTransitionType type,
1521 UDate* transition, UErrorCode* status);
1522
1547 U_STABLE int32_t U_EXPORT2
1548 ucal_getWindowsTimeZoneID(const UChar* id, int32_t len,
1549 UChar* winid, int32_t winidCapacity, UErrorCode* status);
1550
1579 U_STABLE int32_t U_EXPORT2
1580 ucal_getTimeZoneIDForWindowsID(const UChar* winid, int32_t len, const char* region,
1581 UChar* id, int32_t idCapacity, UErrorCode* status);
1582
1583 #endif /* #if !UCONFIG_NO_FORMATTING */
1584
1585 #endif
ucal_clone
UCalendar * ucal_clone(const UCalendar *cal, UErrorCode *status)
Open a copy of a UCalendar.
UCAL_DEFAULT
A better name for UCAL_TRADITIONAL.
Definition: ucal.h:185
UCalendar
void * UCalendar
A calendar.
Definition: ucal.h:169
UCAL_DAY_OF_YEAR
Field number indicating the day number within the current year.
Definition: ucal.h:276
UCAL_AUGUST
August.
Definition: ucal.h:510
UCAL_MAY
May.
Definition: ucal.h:504
UCAL_SHORT_STANDARD
Short standard display name.
Definition: ucal.h:797
UCalendarDateFields
UCalendarDateFields
Possible fields in a UCalendar.
Definition: ucal.h:199
ucal_setGregorianChange
void ucal_setGregorianChange(UCalendar *cal, UDate date, UErrorCode *pErrorCode)
Sets the GregorianCalendar change date.
UCAL_DATE
Field number indicating the day of the month.
Definition: ucal.h:269
ucal_clear
void ucal_clear(UCalendar *calendar)
Clear all fields in a UCalendar.
UCAL_MILLISECONDS_IN_DAY
Ranges from 0 to 23:59:59.999 (regardless of DST).
Definition: ucal.h:434
UCAL_MINIMAL_DAYS_IN_FIRST_WEEK
Minimum number of days in first week.
Definition: ucal.h:905
ucal_getTimeZoneIDForWindowsID
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_countAvailable
int32_t ucal_countAvailable(void)
Determine how many locales have calendars available.
UCAL_LENIENT
Lenient parsing.
Definition: ucal.h:895
UCAL_AM
AM.
Definition: ucal.h:534
UCAL_ERA
Field number indicating the era, e.g., AD or BC in the Gregorian (Julian) calendar.
Definition: ucal.h:205
UCAL_WEEKEND_CEASE
Designates a day that starts as the weekend and transitions to a weekday.
Definition: ucal.h:1384
UCAL_TZ_TRANSITION_NEXT_INCLUSIVE
Get the next transition on or after the current date, i.e.
Definition: ucal.h:1487
ucal_inDaylightTime
UBool ucal_inDaylightTime(const UCalendar *cal, UErrorCode *status)
Determine if a UCalendar is currently in daylight savings time.
UCAL_WEEKDAY
Designates a full weekday (no part of the day is included in the weekend).
Definition: ucal.h:1367
UCAL_UNDECIMBER
Value of the UCAL_MONTH field indicating the thirteenth month of the year.
Definition: ucal.h:523
ucal_get
int32_t ucal_get(const UCalendar *cal, UCalendarDateFields field, UErrorCode *status)
Get the current value of a field from a UCalendar.
ucal_getLimit
int32_t ucal_getLimit(const UCalendar *cal, UCalendarDateFields field, UCalendarLimitType type, UErrorCode *status)
Determine a limit for a field in a UCalendar.
ucal_isSet
UBool ucal_isSet(const UCalendar *cal, UCalendarDateFields field)
Determine if a field in a UCalendar is set.
UCAL_TZ_TRANSITION_NEXT
Get the next transition after the current date, i.e.
Definition: ucal.h:1481
UCAL_MAXIMUM
Maximum value.
Definition: ucal.h:1252
UCAL_JUNE
June.
Definition: ucal.h:506
UCAL_LEAST_MAXIMUM
Leaest maximum value.
Definition: ucal.h:1256
UDate
double UDate
Date and Time data type.
Definition: utypes.h:203
UCAL_WEEK_OF_MONTH
Field number indicating the week number within the current month.
Definition: ucal.h:260
UEnumeration
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition: uenum.h:43
UCAL_MILLISECOND
Field number indicating the millisecond within the second.
Definition: ucal.h:372
UCAL_EXTENDED_YEAR
Year of this calendar system, encompassing all supra-year fields.
Definition: ucal.h:411
UCAL_STANDARD
Standard display name.
Definition: ucal.h:795
ucal_isWeekend
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_ACTUAL_MINIMUM
Actual minimum value.
Definition: ucal.h:1258
UCAL_FRIDAY
Friday.
Definition: ucal.h:483
ucal_getTimeZoneTransitionDate
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,...
ucal_getAvailable
const char * ucal_getAvailable(int32_t localeIndex)
Get a locale for which calendars are available.
UCAL_MINIMUM
Minimum value.
Definition: ucal.h:1250
ucal_getDayOfWeekType
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_equivalentTo
UBool ucal_equivalentTo(const UCalendar *cal1, const UCalendar *cal2)
Returns TRUE if two UCalendars are equivalent.
UCAL_WEDNESDAY
Wednesday.
Definition: ucal.h:479
UCAL_TUESDAY
Tuesday.
Definition: ucal.h:477
UCalendarWeekdayType
UCalendarWeekdayType
Weekday types, as returned by ucal_getDayOfWeekType().
Definition: ucal.h:1362
UCAL_SATURDAY
Saturday.
Definition: ucal.h:485
UCAL_MARCH
March.
Definition: ucal.h:500
UCAL_YEAR_WOY
Field number indicating the extended year corresponding to the UCAL_WEEK_OF_YEAR field.
Definition: ucal.h:395
UCAL_DAY_OF_MONTH
Field number indicating the day of the month.
Definition: ucal.h:458
LocalUCalendarPointer
"Smart pointer" class, closes a UCalendar via ucal_close().
UCalendarAttribute
UCalendarAttribute
Types of UCalendar attributes.
Definition: ucal.h:890
UTimeZoneTransitionType
UTimeZoneTransitionType
Time zone transition types for ucal_getTimeZoneTransitionDate.
Definition: ucal.h:1475
UCAL_TZ_TRANSITION_PREVIOUS
Get the previous transition before the current date, i.e.
Definition: ucal.h:1493
UCAL_WALLTIME_FIRST
An ambiguous wall time to be interpreted as the earliest.
Definition: ucal.h:942
UCAL_SUNDAY
Sunday.
Definition: ucal.h:473
UCalendarWallTimeOption
UCalendarWallTimeOption
Options for handling ambiguous wall time at time zone offset transitions.
Definition: ucal.h:928
UCAL_AM_PM
Field number indicating whether the HOUR is before or after noon.
Definition: ucal.h:328
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:317
UCAL_FIRST_DAY_OF_WEEK
First day of week.
Definition: ucal.h:900
ucal_getTimeZoneID
int32_t ucal_getTimeZoneID(const UCalendar *cal, UChar *result, int32_t resultLength, UErrorCode *status)
Get the ID of the UCalendar's time zone.
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:137
UCAL_FEBRUARY
February.
Definition: ucal.h:498
ucal_getFieldDifference
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_OCTOBER
October.
Definition: ucal.h:514
UCAL_SHORT_DST
Short daylight savings display name.
Definition: ucal.h:801
ucal_getDSTSavings
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_GREATEST_MINIMUM
Greatest minimum value.
Definition: ucal.h:1254
UCalendarDaysOfWeek
UCalendarDaysOfWeek
Useful constant for days of week.
Definition: ucal.h:471
UCAL_NOVEMBER
November.
Definition: ucal.h:516
ucal_getLocaleByType
const char * ucal_getLocaleByType(const UCalendar *cal, ULocDataLocaleType type, UErrorCode *status)
Get the locale for this calendar object.
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:562
UCAL_DST
Daylight savings display name.
Definition: ucal.h:799
UCAL_TRADITIONAL
Despite the name, UCAL_TRADITIONAL designates the locale's default calendar, which may be the Gregori...
Definition: ucal.h:180
ucal_getKeywordValuesForLocale
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...
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
UCAL_JULY
July.
Definition: ucal.h:508
ucal_openTimeZones
UEnumeration * ucal_openTimeZones(UErrorCode *ec)
Create an enumeration over all time zones.
UCAL_ZONE_TYPE_CANONICAL_LOCATION
Canonical system zones associated with actual locations.
Definition: ucal.h:563
UCAL_MONDAY
Monday.
Definition: ucal.h:475
UCAL_HOUR
Field number indicating the hour of the morning or afternoon.
Definition: ucal.h:339
UCAL_MINUTE
Field number indicating the minute within the hour.
Definition: ucal.h:356
ucal_openCountryTimeZones
UEnumeration * ucal_openCountryTimeZones(const char *country, UErrorCode *ec)
Create an enumeration over all time zones associated with the given country.
ucal_open
UCalendar * ucal_open(const UChar *zoneID, int32_t len, const char *locale, UCalendarType type, UErrorCode *status)
Open a UCalendar.
ucal_getAttribute
int32_t ucal_getAttribute(const UCalendar *cal, UCalendarAttribute attr)
Get a numeric attribute associated with a UCalendar.
UCAL_APRIL
April.
Definition: ucal.h:502
ucal_setAttribute
void ucal_setAttribute(UCalendar *cal, UCalendarAttribute attr, int32_t newValue)
Set a numeric attribute associated with a UCalendar.
UCAL_ZONE_TYPE_ANY
Any system zones.
Definition: ucal.h:553
UCAL_DAY_OF_WEEK
Field number indicating the day of the week.
Definition: ucal.h:292
ucal_set
void ucal_set(UCalendar *cal, UCalendarDateFields field, int32_t value)
Set the value of a field in a UCalendar.
UCAL_IS_LEAP_MONTH
Whether or not the current month is a leap month (0 or 1).
Definition: ucal.h:440
UCAL_SKIPPED_WALL_TIME
The behavior for handling skipped wall time at positive time zone offset transitions.
Definition: ucal.h:917
UCAL_YEAR
Field number indicating the year.
Definition: ucal.h:211
UCAL_TZ_TRANSITION_PREVIOUS_INCLUSIVE
Get the previous transition on or before the current date, i.e.
Definition: ucal.h:1499
ucal_close
void ucal_close(UCalendar *cal)
Close a UCalendar.
ucal_getTZDataVersion
const char * ucal_getTZDataVersion(UErrorCode *status)
Returns the timezone data version currently used by ICU.
ucal_setMillis
void ucal_setMillis(UCalendar *cal, UDate dateTime, UErrorCode *status)
Set a UCalendar's current time in millis.
ucal_getWeekendTransition
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.
UCAL_ACTUAL_MAXIMUM
Actual maximum value.
Definition: ucal.h:1260
UChar
uint16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:342
UCalendarType
UCalendarType
Possible types of UCalendars.
Definition: ucal.h:174
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:138
ucal_setDate
void ucal_setDate(UCalendar *cal, int32_t year, int32_t month, int32_t date, UErrorCode *status)
Set a UCalendar's current date.
UCAL_THURSDAY
Thursday.
Definition: ucal.h:481
UCAL_SEPTEMBER
September.
Definition: ucal.h:512
ucal_setDateTime
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.
UCAL_WALLTIME_NEXT_VALID
An ambiguous wall time to be interpreted as the next valid wall time.
Definition: ucal.h:948
UCAL_ZONE_TYPE_CANONICAL
Canonical system zones.
Definition: ucal.h:558
USystemTimeZoneType
USystemTimeZoneType
System time zone type constants used by filtering zones in ucal_openTimeZoneIDEnumeration.
Definition: ucal.h:548
UCAL_DOW_LOCAL
Field number indicating the localized day of week.
Definition: ucal.h:403
UCAL_WEEKEND
Designates a full weekend day (the entire day is included in the weekend).
Definition: ucal.h:1372
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition: utypes.h:401
ucal_add
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_setDefaultTimeZone
void ucal_setDefaultTimeZone(const UChar *zoneID, UErrorCode *ec)
Set the default time zone.
ULocDataLocaleType
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested,...
Definition: uloc.h:338
UCAL_GREGORIAN
Unambiguously designates the Gregorian calendar for the locale.
Definition: ucal.h:190
uenum.h
C API: String Enumeration.
ucal_getDefaultTimeZone
int32_t ucal_getDefaultTimeZone(UChar *result, int32_t resultCapacity, UErrorCode *ec)
Return the default time zone.
UCAL_JANUARY
January.
Definition: ucal.h:496
ucal_getWindowsTimeZoneID
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_getType
const char * ucal_getType(const UCalendar *cal, UErrorCode *status)
Get the resource keyword value string designating the calendar type for the UCalendar.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UCAL_REPEATED_WALL_TIME
The behavior for handling wall time repeating multiple times at negative time zone offset transitions...
Definition: ucal.h:911
ucal_getTimeZoneDisplayName
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.
UCAL_WEEKEND_ONSET
Designates a day that starts as a weekday and transitions to the weekend.
Definition: ucal.h:1378
UCAL_DST_OFFSET
Field number indicating the daylight savings offset in milliseconds.
Definition: ucal.h:386
UCAL_SECOND
Field number indicating the second within the minute.
Definition: ucal.h:364
UCAL_FIELD_COUNT
One more than the highest normal UCalendarDateFields value.
Definition: ucal.h:448
ucal_roll
void ucal_roll(UCalendar *cal, UCalendarDateFields field, int32_t amount, UErrorCode *status)
Add a specified signed amount to a particular field in a UCalendar.
UCalendarDisplayNameType
UCalendarDisplayNameType
Possible formats for a UCalendar's display name.
Definition: ucal.h:793
UCAL_ZONE_OFFSET
Field number indicating the raw offset from GMT in milliseconds.
Definition: ucal.h:379
ucal_setTimeZone
void ucal_setTimeZone(UCalendar *cal, const UChar *zoneID, int32_t len, UErrorCode *status)
Set the TimeZone used by a UCalendar.
ucal_getCanonicalTimeZoneID
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...
UCalendarAMPMs
UCalendarAMPMs
Possible AM/PM values in a UCalendar.
Definition: ucal.h:532
UCAL_WEEK_OF_YEAR
Field number indicating the week number within the current year.
Definition: ucal.h:245
UCalendarLimitType
UCalendarLimitType
Possible limit values for a UCalendar.
Definition: ucal.h:1248
ucal_getNow
UDate ucal_getNow(void)
Get the current date and time.
UCalendarMonths
UCalendarMonths
Possible months in a UCalendar.
Definition: ucal.h:494
UCAL_DECEMBER
December.
Definition: ucal.h:518
ucal_openTimeZoneIDEnumeration
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.
UCAL_WALLTIME_LAST
An ambiguous wall time to be interpreted as the latest.
Definition: ucal.h:935
UCAL_HOUR_OF_DAY
Field number indicating the hour of the day.
Definition: ucal.h:348
UCAL_JULIAN_DAY
Field number indicating the modified Julian day number.
Definition: ucal.h:423
ucal_getMillis
UDate ucal_getMillis(const UCalendar *cal, UErrorCode *status)
Get a UCalendar's current time in millis.
ucal_getGregorianChange
UDate ucal_getGregorianChange(const UCalendar *cal, UErrorCode *pErrorCode)
Gets the Gregorian Calendar change date.
ucal_clearField
void ucal_clearField(UCalendar *cal, UCalendarDateFields field)
Clear a field in a UCalendar.
U_STABLE
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:111
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:225
UCAL_MONTH
Field number indicating the month.
Definition: ucal.h:232
UCAL_PM
PM.
Definition: ucal.h:536
uloc.h
C API: Locale.