1b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/* 2b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru ******************************************************************************* 3fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Copyright (C) 1996-2014, International Business Machines Corporation and 4b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * others. All Rights Reserved. 5b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru ******************************************************************************* 6b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 7b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 8b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#ifndef UCAL_H 9b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define UCAL_H 10b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 11b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/utypes.h" 12b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/uenum.h" 13b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/uloc.h" 1450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#include "unicode/localpointer.h" 15b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 16b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#if !UCONFIG_NO_FORMATTING 17b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 18b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 19b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \file 20b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \brief C API: Calendar 21b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 22b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <h2>Calendar C API</h2> 23b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 24b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCalendar C API is used for converting between a <code>UDate</code> object 25b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * and a set of integer fields such as <code>UCAL_YEAR</code>, <code>UCAL_MONTH</code>, 26b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>UCAL_DAY</code>, <code>UCAL_HOUR</code>, and so on. 27b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * (A <code>UDate</code> object represents a specific instant in 28b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * time with millisecond precision. See UDate 29b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * for information about the <code>UDate</code> .) 30b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 31b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p> 32b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Types of <code>UCalendar</code> interpret a <code>UDate</code> 33b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * according to the rules of a specific calendar system. The U_STABLE 34b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * provides the enum UCalendarType with UCAL_TRADITIONAL and 35b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_GREGORIAN. 36b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p> 37b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Like other locale-sensitive C API, calendar API provides a 38b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * function, <code>ucal_open()</code>, which returns a pointer to 39b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>UCalendar</code> whose time fields have been initialized 40b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * with the current date and time. We need to specify the type of 41b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * calendar to be opened and the timezoneId. 42b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \htmlonly<blockquote>\endhtmlonly 43b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <pre> 44b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \code 45b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCalendar *caldef; 46b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UChar *tzId; 47b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UErrorCode status; 48b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * tzId=(UChar*)malloc(sizeof(UChar) * (strlen("PST") +1) ); 49b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * u_uastrcpy(tzId, "PST"); 50b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * caldef=ucal_open(tzID, u_strlen(tzID), NULL, UCAL_TRADITIONAL, &status); 51b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \endcode 52b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * </pre> 53b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \htmlonly</blockquote>\endhtmlonly 54b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 55b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p> 56b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * A <code>UCalendar</code> object can produce all the time field values 57b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * needed to implement the date-time formatting for a particular language 58b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * and calendar style (for example, Japanese-Gregorian, Japanese-Traditional). 59b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 60b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p> 61b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * When computing a <code>UDate</code> from time fields, two special circumstances 62b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * may arise: there may be insufficient information to compute the 63b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>UDate</code> (such as only year and month but no day in the month), 64b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * or there may be inconsistent information (such as "Tuesday, July 15, 1996" 65b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * -- July 15, 1996 is actually a Monday). 66b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 67b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p> 68b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <strong>Insufficient information.</strong> The calendar will use default 69b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * information to specify the missing fields. This may vary by calendar; for 70b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the Gregorian calendar, the default for a field is the same as that of the 71b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * start of the epoch: i.e., UCAL_YEAR = 1970, UCAL_MONTH = JANUARY, UCAL_DATE = 1, etc. 72b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 73b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p> 74b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <strong>Inconsistent information.</strong> If fields conflict, the calendar 75b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * will give preference to fields set more recently. For example, when 76b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * determining the day, the calendar will look for one of the following 77b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * combinations of fields. The most recent combination, as determined by the 78b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * most recently set single field, will be used. 79b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 80b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \htmlonly<blockquote>\endhtmlonly 81b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <pre> 82b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \code 83b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_MONTH + UCAL_DAY_OF_MONTH 84b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_MONTH + UCAL_WEEK_OF_MONTH + UCAL_DAY_OF_WEEK 85b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_MONTH + UCAL_DAY_OF_WEEK_IN_MONTH + UCAL_DAY_OF_WEEK 86b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DAY_OF_YEAR 87b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DAY_OF_WEEK + UCAL_WEEK_OF_YEAR 88b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \endcode 89b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * </pre> 90b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \htmlonly</blockquote>\endhtmlonly 91b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 92b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * For the time of day: 93b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 94b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \htmlonly<blockquote>\endhtmlonly 95b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <pre> 96b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \code 97b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_HOUR_OF_DAY 98b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_AM_PM + UCAL_HOUR 99b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \endcode 100b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * </pre> 101b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \htmlonly</blockquote>\endhtmlonly 102b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 103b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p> 104b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <strong>Note:</strong> for some non-Gregorian calendars, different 105b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * fields may be necessary for complete disambiguation. For example, a full 106b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * specification of the historial Arabic astronomical calendar requires year, 107b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * month, day-of-month <em>and</em> day-of-week in some cases. 108b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 109b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p> 110b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <strong>Note:</strong> There are certain possible ambiguities in 111b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * interpretation of certain singular times, which are resolved in the 112b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * following ways: 113b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <ol> 114b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <li> 24:00:00 "belongs" to the following day. That is, 115b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 23:59 on Dec 31, 1969 < 24:00 on Jan 1, 1970 < 24:01:00 on Jan 1, 1970 116b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 117b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <li> Although historically not precise, midnight also belongs to "am", 118b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * and noon belongs to "pm", so on the same day, 119b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 12:00 am (midnight) < 12:01 am, and 12:00 pm (noon) < 12:01 pm 120b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * </ol> 121b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 122b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p> 123b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The date or time format strings are not part of the definition of a 124b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * calendar, as those must be modifiable or overridable by the user at 12554dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * runtime. Use {@link icu::DateFormat} 126b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to format dates. 127b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 128b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p> 129b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>Calendar</code> provides an API for field "rolling", where fields 130b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * can be incremented or decremented, but wrap around. For example, rolling the 131b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * month up in the date <code>December 12, <b>1996</b></code> results in 132b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>January 12, <b>1996</b></code>. 133b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 134b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p> 135b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>Calendar</code> also provides a date arithmetic function for 136b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * adding the specified (signed) amount of time to a particular time field. 137b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * For example, subtracting 5 days from the date <code>September 12, 1996</code> 138b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * results in <code>September 7, 1996</code>. 139b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 140b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 141b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 142b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 143b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho/** 144b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * The time zone ID reserved for unknown time zone. 145103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * @stable ICU 4.8 146b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho */ 147b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho#define UCAL_UNKNOWN_ZONE_ID "Etc/Unknown" 148b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho 149b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** A calendar. 150b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * For usage in C programs. 151b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 152b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 153b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querutypedef void* UCalendar; 154b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 155b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Possible types of UCalendars 156b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 157b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 158b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruenum UCalendarType { 159b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru /** 160b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Despite the name, UCAL_TRADITIONAL designates the locale's default calendar, 161b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * which may be the Gregorian calendar or some other calendar. 162b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @stable ICU 2.0 163b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */ 164b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_TRADITIONAL, 165b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru /** 166b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * A better name for UCAL_TRADITIONAL. 16727f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2 168b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */ 16950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho UCAL_DEFAULT = UCAL_TRADITIONAL, 17050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho /** 17150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Unambiguously designates the Gregorian calendar for the locale. 17250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @stable ICU 2.0 17350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 17450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho UCAL_GREGORIAN 175b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}; 176b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 177b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** @stable ICU 2.0 */ 178b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querutypedef enum UCalendarType UCalendarType; 179b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 180b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Possible fields in a UCalendar 181b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 182b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 183b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruenum UCalendarDateFields { 184b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 185b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating the era, e.g., AD or BC in the Gregorian (Julian) calendar. 186b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This is a calendar-specific value. 187b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 188b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 189b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_ERA, 190b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 191b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 192b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating the year. This is a calendar-specific value. 193b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 194b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 195b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_YEAR, 196b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 197b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 198b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating the month. This is a calendar-specific value. 199b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The first month of the year is 200b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>JANUARY</code>; the last depends on the number of months in a year. 201b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_JANUARY 202b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_FEBRUARY 203b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_MARCH 204b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_APRIL 205b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_MAY 206b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_JUNE 207b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_JULY 208b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_AUGUST 209b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_SEPTEMBER 210b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_OCTOBER 211b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_NOVEMBER 212b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_DECEMBER 213b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_UNDECIMBER 214b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 215b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 216b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_MONTH, 217b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 218b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 219b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating the 220b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * week number within the current year. The first week of the year, as 221b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * defined by <code>UCAL_FIRST_DAY_OF_WEEK</code> and <code>UCAL_MINIMAL_DAYS_IN_FIRST_WEEK</code> 222b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * attributes, has value 1. Subclasses define 223b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the value of <code>UCAL_WEEK_OF_YEAR</code> for days before the first week of 224b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the year. 225b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_getAttribute 226b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setAttribute 227b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 228b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 229b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_WEEK_OF_YEAR, 230b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 231b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 232b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating the 233b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * week number within the current month. The first week of the month, as 234b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * defined by <code>UCAL_FIRST_DAY_OF_WEEK</code> and <code>UCAL_MINIMAL_DAYS_IN_FIRST_WEEK</code> 235b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * attributes, has value 1. Subclasses define 236b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the value of <code>WEEK_OF_MONTH</code> for days before the first week of 237b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the month. 238b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_getAttribute 239b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setAttribute 240b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_FIRST_DAY_OF_WEEK 241b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_MINIMAL_DAYS_IN_FIRST_WEEK 242b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 243b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 244b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_WEEK_OF_MONTH, 245b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 246b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 247b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating the 248b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * day of the month. This is a synonym for <code>DAY_OF_MONTH</code>. 249b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The first day of the month has value 1. 250b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_DAY_OF_MONTH 251b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 252b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 253b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_DATE, 254b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 255b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 256b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating the day 257b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * number within the current year. The first day of the year has value 1. 258b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 259b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 260b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_DAY_OF_YEAR, 261b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 262b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 263b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating the day 264b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * of the week. This field takes values <code>SUNDAY</code>, 265b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>MONDAY</code>, <code>TUESDAY</code>, <code>WEDNESDAY</code>, 266b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>THURSDAY</code>, <code>FRIDAY</code>, and <code>SATURDAY</code>. 267b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_SUNDAY 268b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_MONDAY 269b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_TUESDAY 270b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_WEDNESDAY 271b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_THURSDAY 272b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_FRIDAY 273b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_SATURDAY 274b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 275b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 276b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_DAY_OF_WEEK, 277b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 278b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 279b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating the 280b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * ordinal number of the day of the week within the current month. Together 281b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * with the <code>DAY_OF_WEEK</code> field, this uniquely specifies a day 282b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * within a month. Unlike <code>WEEK_OF_MONTH</code> and 283b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>WEEK_OF_YEAR</code>, this field's value does <em>not</em> depend on 284b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>getFirstDayOfWeek()</code> or 285b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>getMinimalDaysInFirstWeek()</code>. <code>DAY_OF_MONTH 1</code> 286b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * through <code>7</code> always correspond to <code>DAY_OF_WEEK_IN_MONTH 287b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 1</code>; <code>8</code> through <code>15</code> correspond to 288b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>DAY_OF_WEEK_IN_MONTH 2</code>, and so on. 289b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>DAY_OF_WEEK_IN_MONTH 0</code> indicates the week before 290b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>DAY_OF_WEEK_IN_MONTH 1</code>. Negative values count back from the 291b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * end of the month, so the last Sunday of a month is specified as 292b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>DAY_OF_WEEK = SUNDAY, DAY_OF_WEEK_IN_MONTH = -1</code>. Because 293b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * negative values count backward they will usually be aligned differently 294b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * within the month than positive values. For example, if a month has 31 295b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * days, <code>DAY_OF_WEEK_IN_MONTH -1</code> will overlap 296b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>DAY_OF_WEEK_IN_MONTH 5</code> and the end of <code>4</code>. 297b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_DAY_OF_WEEK 298b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_WEEK_OF_MONTH 299b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 300b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 301b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_DAY_OF_WEEK_IN_MONTH, 302b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 303b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 304b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating 305b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * whether the <code>HOUR</code> is before or after noon. 306b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * E.g., at 10:04:15.250 PM the <code>AM_PM</code> is <code>PM</code>. 307b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_AM 308b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_PM 309b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_HOUR 310b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 311b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 312b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_AM_PM, 313b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 314b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 315b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating the 316b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * hour of the morning or afternoon. <code>HOUR</code> is used for the 12-hour 317b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * clock. 318b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * E.g., at 10:04:15.250 PM the <code>HOUR</code> is 10. 319b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_AM_PM 320b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_HOUR_OF_DAY 321b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 322b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 323b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_HOUR, 324b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 325b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 326b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating the 327b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * hour of the day. <code>HOUR_OF_DAY</code> is used for the 24-hour clock. 328b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * E.g., at 10:04:15.250 PM the <code>HOUR_OF_DAY</code> is 22. 329b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_HOUR 330b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 331b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 332b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_HOUR_OF_DAY, 333b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 334b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 335b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating the 336b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * minute within the hour. 337b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * E.g., at 10:04:15.250 PM the <code>UCAL_MINUTE</code> is 4. 338b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 339b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 340b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_MINUTE, 341b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 342b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 343b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating the 344b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * second within the minute. 345b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * E.g., at 10:04:15.250 PM the <code>UCAL_SECOND</code> is 15. 346b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 347b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 348b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_SECOND, 349b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 350b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 351b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating the 352b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * millisecond within the second. 353b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * E.g., at 10:04:15.250 PM the <code>UCAL_MILLISECOND</code> is 250. 354b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 355b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 356b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_MILLISECOND, 357b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 358b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 359b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating the 360b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * raw offset from GMT in milliseconds. 361b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 362b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 363b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_ZONE_OFFSET, 364b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 365b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 366b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating the 367b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * daylight savings offset in milliseconds. 368b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 369b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 370b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_DST_OFFSET, 371b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 372b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 373b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number 374b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * indicating the extended year corresponding to the 375b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>UCAL_WEEK_OF_YEAR</code> field. This may be one greater or less 376b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * than the value of <code>UCAL_EXTENDED_YEAR</code>. 377b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 378b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 379b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_YEAR_WOY, 380b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 381b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 382b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number 383b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * indicating the localized day of week. This will be a value from 1 384b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to 7 inclusive, with 1 being the localized first day of the week. 385b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 386b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 387b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_DOW_LOCAL, 388b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 389b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 390b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Year of this calendar system, encompassing all supra-year fields. For example, 391b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * in Gregorian/Julian calendars, positive Extended Year values indicate years AD, 392b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 1 BC = 0 extended, 2 BC = -1 extended, and so on. 393b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.8 394b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 395b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_EXTENDED_YEAR, 396b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 397b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 398b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number 399b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * indicating the modified Julian day number. This is different from 400b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the conventional Julian day number in two regards. First, it 401b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * demarcates days at local zone midnight, rather than noon GMT. 402b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Second, it is a local number; that is, it depends on the local time 403b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * zone. It can be thought of as a single number that encompasses all 404b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the date-related fields. 405b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.8 406b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 407b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_JULIAN_DAY, 408b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 409b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 410b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Ranges from 0 to 23:59:59.999 (regardless of DST). This field behaves <em>exactly</em> 411b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * like a composite of all time-related fields, not including the zone fields. As such, 412b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * it also reflects discontinuities of those fields on DST transition days. On a day 413b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * of DST onset, it will jump forward. On a day of DST cessation, it will jump 414b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * backward. This reflects the fact that it must be combined with the DST_OFFSET field 415b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to obtain a unique local time value. 416b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.8 417b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 418b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_MILLISECONDS_IN_DAY, 419c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru 420c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru /** 421c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * Whether or not the current month is a leap month (0 or 1). See the Chinese calendar for 422c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * an example of this. 423c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru */ 424c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru UCAL_IS_LEAP_MONTH, 425b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 426b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 427b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field count 428b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 429b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 430b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_FIELD_COUNT, 431b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 432b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 433b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Field number indicating the 434b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * day of the month. This is a synonym for <code>UCAL_DATE</code>. 435b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The first day of the month has value 1. 436b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see #UCAL_DATE 437b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Synonym for UCAL_DATE 438b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.8 439b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru **/ 440b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_DAY_OF_MONTH=UCAL_DATE 441b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}; 442b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 443b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** @stable ICU 2.0 */ 444b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querutypedef enum UCalendarDateFields UCalendarDateFields; 445b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 446b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Useful constant for days of week. Note: Calendar day-of-week is 1-based. Clients 447b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * who create locale resources for the field of first-day-of-week should be aware of 448b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * this. For instance, in US locale, first-day-of-week is set to 1, i.e., UCAL_SUNDAY. 449b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 450b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Possible days of the week in a UCalendar 451b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 452b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 453b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruenum UCalendarDaysOfWeek { 454b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Sunday */ 455b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_SUNDAY = 1, 456b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Monday */ 457b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_MONDAY, 458b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Tuesday */ 459b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_TUESDAY, 460b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Wednesday */ 461b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_WEDNESDAY, 462b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Thursday */ 463b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_THURSDAY, 464b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Friday */ 465b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_FRIDAY, 466b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Saturday */ 467b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_SATURDAY 468b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}; 469b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 470b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** @stable ICU 2.0 */ 471b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querutypedef enum UCalendarDaysOfWeek UCalendarDaysOfWeek; 472b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 473b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Possible months in a UCalendar. Note: Calendar month is 0-based. 474b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 475b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 476b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruenum UCalendarMonths { 477b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** January */ 478b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_JANUARY, 479b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** February */ 480b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_FEBRUARY, 481b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** March */ 482b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_MARCH, 483b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** April */ 484b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_APRIL, 485b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** May */ 486b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_MAY, 487b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** June */ 488b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_JUNE, 489b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** July */ 490b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_JULY, 491b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** August */ 492b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_AUGUST, 493b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** September */ 494b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_SEPTEMBER, 495b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** October */ 496b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_OCTOBER, 497b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** November */ 498b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_NOVEMBER, 499b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** December */ 500b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_DECEMBER, 501b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Value of the <code>UCAL_MONTH</code> field indicating the 502b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * thirteenth month of the year. Although the Gregorian calendar 503b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * does not use this value, lunar calendars do. 504b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 505b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_UNDECIMBER 506b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}; 507b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 508b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** @stable ICU 2.0 */ 509b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querutypedef enum UCalendarMonths UCalendarMonths; 510b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 511b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Possible AM/PM values in a UCalendar 512b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 513b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 514b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruenum UCalendarAMPMs { 515b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** AM */ 516b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_AM, 517b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** PM */ 518b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_PM 519b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}; 520b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 521b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** @stable ICU 2.0 */ 522b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querutypedef enum UCalendarAMPMs UCalendarAMPMs; 523b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 524b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 525b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * System time zone type constants used by filtering zones 526b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * in ucal_openTimeZoneIDEnumeration. 527b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @see ucal_openTimeZoneIDEnumeration 528103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * @stable ICU 4.8 529b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho */ 530b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2clairehoenum USystemTimeZoneType { 531b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho /** 532b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * Any system zones. 533103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * @stable ICU 4.8 534b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho */ 535b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho UCAL_ZONE_TYPE_ANY, 536b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho /** 537b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * Canonical system zones. 538103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * @stable ICU 4.8 539b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho */ 540b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho UCAL_ZONE_TYPE_CANONICAL, 541b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho /** 542b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * Canonical system zones associated with actual locations. 543103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * @stable ICU 4.8 544b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho */ 545b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho UCAL_ZONE_TYPE_CANONICAL_LOCATION 546b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho}; 547b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho 548103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius/** @stable ICU 4.8 */ 549b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2clairehotypedef enum USystemTimeZoneType USystemTimeZoneType; 550b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho 551b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho/** 552b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * Create an enumeration over system time zone IDs with the given 553b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * filter conditions. 554b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @param zoneType The system time zone type. 555b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @param region The ISO 3166 two-letter country code or UN M.49 556b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * three-digit area code. When NULL, no filtering 557b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * done by region. 558b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @param rawOffset An offset from GMT in milliseconds, ignoring the 559b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * effect of daylight savings time, if any. When NULL, 560b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * no filtering done by zone offset. 561b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @param ec A pointer to an UErrorCode to receive any errors 562b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @return an enumeration object that the caller must dispose of 563b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * using enum_close(), or NULL upon failure. In case of failure, 564b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * *ec will indicate the error. 565103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * @stable ICU 4.8 566b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho */ 56754dcd9b6a06071f647dac967e9e267abb9410720Craig CorneliusU_STABLE UEnumeration* U_EXPORT2 568b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2clairehoucal_openTimeZoneIDEnumeration(USystemTimeZoneType zoneType, const char* region, 569b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho const int32_t* rawOffset, UErrorCode* ec); 570b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho 571b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho/** 572b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Create an enumeration over all time zones. 573b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 574b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param ec input/output error code 575b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 576b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return an enumeration object that the caller must dispose of using 577b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * uenum_close(), or NULL upon failure. In case of failure *ec will 578b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * indicate the error. 579b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 580b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 581b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 582b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UEnumeration* U_EXPORT2 583b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_openTimeZones(UErrorCode* ec); 584b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 585b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 586b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Create an enumeration over all time zones associated with the given 587b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * country. Some zones are affiliated with no country (e.g., "UTC"); 588b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * these may also be retrieved, as a group. 589b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 590b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param country the ISO 3166 two-letter country code, or NULL to 591b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * retrieve zones not affiliated with any country 592b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 593b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param ec input/output error code 594b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 595b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return an enumeration object that the caller must dispose of using 596b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * uenum_close(), or NULL upon failure. In case of failure *ec will 597b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * indicate the error. 598b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 599b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 600b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 601b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UEnumeration* U_EXPORT2 602b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_openCountryTimeZones(const char* country, UErrorCode* ec); 603b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 604b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 605b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Return the default time zone. The default is determined initially 606b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * by querying the host operating system. It may be changed with 607b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * ucal_setDefaultTimeZone() or with the C++ TimeZone API. 608b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 609b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param result A buffer to receive the result, or NULL 610b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 611b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resultCapacity The capacity of the result buffer 612b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 613b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param ec input/output error code 614b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 615b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The result string length, not including the terminating 616b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * null 617b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 618b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 619b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 620b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE int32_t U_EXPORT2 621b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_getDefaultTimeZone(UChar* result, int32_t resultCapacity, UErrorCode* ec); 622b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 623b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 624b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set the default time zone. 625b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 626b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param zoneID null-terminated time zone ID 627b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 628b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param ec input/output error code 629b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 630b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 631b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 632b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 633b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_setDefaultTimeZone(const UChar* zoneID, UErrorCode* ec); 634b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 635b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 636b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Return the amount of time in milliseconds that the clock is 637b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * advanced during daylight savings time for the given time zone, or 638b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * zero if the time zone does not observe daylight savings time. 639b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 640b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param zoneID null-terminated time zone ID 641b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 642b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param ec input/output error code 643b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 644b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return the number of milliseconds the time is advanced with 645b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * respect to standard time when the daylight savings rules are in 646b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * effect. This is always a non-negative number, most commonly either 647b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 3,600,000 (one hour) or zero. 648b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 649b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 650b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 651b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE int32_t U_EXPORT2 652b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_getDSTSavings(const UChar* zoneID, UErrorCode* ec); 653b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 654b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 655b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Get the current date and time. 656b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The value returned is represented as milliseconds from the epoch. 657b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The current date and time. 658b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 659b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 660b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UDate U_EXPORT2 661b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_getNow(void); 662b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 663b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 664b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Open a UCalendar. 665b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * A UCalendar may be used to convert a millisecond value to a year, 666b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * month, and day. 667b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * <p> 668103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * Note: When unknown TimeZone ID is specified or if the TimeZone ID specified is "Etc/Unknown", 669103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * the UCalendar returned by the function is initialized with GMT zone with TimeZone ID 670103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * <code>UCAL_UNKNOWN_ZONE_ID</code> ("Etc/Unknown") without any errors/warnings. If you want 671103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * to check if a TimeZone ID is valid prior to this function, use <code>ucal_getCanonicalTimeZoneID</code>. 672b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * 673b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param zoneID The desired TimeZone ID. If 0, use the default time zone. 674b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param len The length of zoneID, or -1 if null-terminated. 675b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param locale The desired locale 676b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param type The type of UCalendar to open. This can be UCAL_GREGORIAN to open the Gregorian 677b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * calendar for the locale, or UCAL_DEFAULT to open the default calendar for the locale (the 678b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * default calendar may also be Gregorian). To open a specific non-Gregorian calendar for the 679b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * locale, use uloc_setKeywordValue to set the value of the calendar keyword for the locale 680b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * and then pass the locale to ucal_open with UCAL_DEFAULT as the type. 681b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 682b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return A pointer to a UCalendar, or 0 if an error occurred. 683b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @see #UCAL_UNKNOWN_ZONE_ID 684b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 685b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 686b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UCalendar* U_EXPORT2 687b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_open(const UChar* zoneID, 688b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t len, 689b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru const char* locale, 690b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarType type, 691b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status); 692b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 693b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 694b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Close a UCalendar. 695b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Once closed, a UCalendar may no longer be used. 696b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to close. 697b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 698b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 699b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 700b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_close(UCalendar *cal); 701b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 70250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#if U_SHOW_CPLUSPLUS_API 70350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho 70450294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoU_NAMESPACE_BEGIN 70550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho 70650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/** 70750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * \class LocalUCalendarPointer 70850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * "Smart pointer" class, closes a UCalendar via ucal_close(). 70950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * For most methods see the LocalPointerBase base class. 71050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * 71150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @see LocalPointerBase 71250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @see LocalPointer 71327f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4 71450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 71550294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoU_DEFINE_LOCAL_OPEN_POINTER(LocalUCalendarPointer, UCalendar, ucal_close); 71650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho 71750294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoU_NAMESPACE_END 71850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho 71950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#endif 72050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho 721b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 722c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * Open a copy of a UCalendar. 723c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * This function performs a deep copy. 724c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * @param cal The calendar to copy 725c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors. 726c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * @return A pointer to a UCalendar identical to cal. 727b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @stable ICU 4.0 728c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru */ 72950294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoU_STABLE UCalendar* U_EXPORT2 730c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queruucal_clone(const UCalendar* cal, 731c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru UErrorCode* status); 732c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru 733c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru/** 734b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set the TimeZone used by a UCalendar. 735b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * A UCalendar uses a timezone for converting from Greenwich time to local time. 736b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to set. 737b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param zoneID The desired TimeZone ID. If 0, use the default time zone. 738b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param len The length of zoneID, or -1 if null-terminated. 739b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors. 740b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 741b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 742b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 743b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_setTimeZone(UCalendar* cal, 744b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru const UChar* zoneID, 745b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t len, 746b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status); 747b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 7488393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius/** 7498393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * Get the ID of the UCalendar's time zone. 7508393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * 7518393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * @param cal The UCalendar to query. 7528393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * @param result Receives the UCalendar's time zone ID. 7538393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * @param resultLength The maximum size of result. 7548393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * @param status Receives the status. 7558393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * @return The total buffer size needed; if greater than resultLength, the output was truncated. 756fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @stable ICU 51 7578393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius */ 7588393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig CorneliusU_DRAFT int32_t U_EXPORT2 7598393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Corneliusucal_getTimeZoneID(const UCalendar *cal, 7608393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius UChar *result, 7618393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius int32_t resultLength, 7628393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius UErrorCode *status); 7638393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius 764b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 765b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Possible formats for a UCalendar's display name 766b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 767b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 768b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruenum UCalendarDisplayNameType { 769b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Standard display name */ 770b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_STANDARD, 771b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Short standard display name */ 772b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_SHORT_STANDARD, 773b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Daylight savings display name */ 774b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_DST, 775b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Short daylight savings display name */ 776b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_SHORT_DST 777b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}; 778b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 779b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** @stable ICU 2.0 */ 780b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querutypedef enum UCalendarDisplayNameType UCalendarDisplayNameType; 781b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 782b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 783b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Get the display name for a UCalendar's TimeZone. 784b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * A display name is suitable for presentation to a user. 785b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to query. 786b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param type The desired display name format; one of UCAL_STANDARD, UCAL_SHORT_STANDARD, 787b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DST, UCAL_SHORT_DST 788b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param locale The desired locale for the display name. 789b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param result A pointer to a buffer to receive the formatted number. 790b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resultLength The maximum size of result. 791b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 792b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The total buffer size needed; if greater than resultLength, the output was truncated. 793b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 794b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 795b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE int32_t U_EXPORT2 796b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_getTimeZoneDisplayName(const UCalendar* cal, 797b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarDisplayNameType type, 798b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru const char* locale, 799b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UChar* result, 800b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t resultLength, 801b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status); 802b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 803b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 804b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Determine if a UCalendar is currently in daylight savings time. 805b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Daylight savings time is not used in all parts of the world. 806b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to query. 807b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 808b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return TRUE if cal is currently in daylight savings time, FALSE otherwise 809b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 810b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 811b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UBool U_EXPORT2 812b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_inDaylightTime(const UCalendar* cal, 813b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status ); 814b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 815b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 816b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Sets the GregorianCalendar change date. This is the point when the switch from 817b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Julian dates to Gregorian dates occurred. Default is 00:00:00 local time, October 818b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 15, 1582. Previous to this time and date will be Julian dates. 819b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 820b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This function works only for Gregorian calendars. If the UCalendar is not 821b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * an instance of a Gregorian calendar, then a U_UNSUPPORTED_ERROR 822b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * error code is set. 823b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 824b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The calendar object. 825b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param date The given Gregorian cutover date. 826b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param pErrorCode Pointer to a standard ICU error code. Its input value must 827b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * pass the U_SUCCESS() test, or else the function returns 828b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * immediately. Check for U_FAILURE() on output or use with 829b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * function chaining. (See User Guide for details.) 830b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 831b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see GregorianCalendar::setGregorianChange 832b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_getGregorianChange 833b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 3.6 834b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 835b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 836b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_setGregorianChange(UCalendar *cal, UDate date, UErrorCode *pErrorCode); 837b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 838b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 839b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Gets the Gregorian Calendar change date. This is the point when the switch from 840b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Julian dates to Gregorian dates occurred. Default is 00:00:00 local time, October 841b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 15, 1582. Previous to this time and date will be Julian dates. 842b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 843b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This function works only for Gregorian calendars. If the UCalendar is not 844b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * an instance of a Gregorian calendar, then a U_UNSUPPORTED_ERROR 845b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * error code is set. 846b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 847b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The calendar object. 848b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param pErrorCode Pointer to a standard ICU error code. Its input value must 849b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * pass the U_SUCCESS() test, or else the function returns 850b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * immediately. Check for U_FAILURE() on output or use with 851b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * function chaining. (See User Guide for details.) 852b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The Gregorian cutover time for this calendar. 853b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 854b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see GregorianCalendar::getGregorianChange 855b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setGregorianChange 856b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 3.6 857b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 858b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UDate U_EXPORT2 859b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_getGregorianChange(const UCalendar *cal, UErrorCode *pErrorCode); 860b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 861b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 862b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Types of UCalendar attributes 863b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 864b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 865b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruenum UCalendarAttribute { 866103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius /** 867103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * Lenient parsing 868103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * @stable ICU 2.0 869103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius */ 870b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_LENIENT, 871103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius /** 872103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * First day of week 873103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * @stable ICU 2.0 874103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius */ 875b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_FIRST_DAY_OF_WEEK, 876103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius /** 877103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * Minimum number of days in first week 878103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * @stable ICU 2.0 879103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius */ 8808393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius UCAL_MINIMAL_DAYS_IN_FIRST_WEEK, 881103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius /** 882103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * The behavior for handling wall time repeating multiple times 883103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * at negative time zone offset transitions 8848393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * @stable ICU 49 885103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius */ 886103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius UCAL_REPEATED_WALL_TIME, 887103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius /** 888103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * The behavior for handling skipped wall time at positive time 889103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * zone offset transitions. 8908393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * @stable ICU 49 891103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius */ 892103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius UCAL_SKIPPED_WALL_TIME 893b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}; 894b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 895b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** @stable ICU 2.0 */ 896b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querutypedef enum UCalendarAttribute UCalendarAttribute; 897b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 898b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 899103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * Options for handling ambiguous wall time at time zone 900103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * offset transitions. 9018393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * @stable ICU 49 902103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius */ 903103e9ffba2cba345d0078eb8b8db33249f81840aCraig Corneliusenum UCalendarWallTimeOption { 904103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius /** 905103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * An ambiguous wall time to be interpreted as the latest. 906103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * This option is valid for UCAL_REPEATED_WALL_TIME and 907103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * UCAL_SKIPPED_WALL_TIME. 9088393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * @stable ICU 49 909103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius */ 9108393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius UCAL_WALLTIME_LAST, 911103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius /** 912103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * An ambiguous wall time to be interpreted as the earliest. 913103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * This option is valid for UCAL_REPEATED_WALL_TIME and 914103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * UCAL_SKIPPED_WALL_TIME. 9158393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * @stable ICU 49 916103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius */ 917103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius UCAL_WALLTIME_FIRST, 918103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius /** 919103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * An ambiguous wall time to be interpreted as the next valid 920103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * wall time. This option is valid for UCAL_SKIPPED_WALL_TIME. 9218393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * @stable ICU 49 922103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius */ 923103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius UCAL_WALLTIME_NEXT_VALID 924103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius}; 9258393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius/** @stable ICU 49 */ 926103e9ffba2cba345d0078eb8b8db33249f81840aCraig Corneliustypedef enum UCalendarWallTimeOption UCalendarWallTimeOption; 927103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius 928103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius/** 929b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Get a numeric attribute associated with a UCalendar. 930b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Numeric attributes include the first day of the week, or the minimal numbers 931b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * of days in the first week of the month. 932b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to query. 933b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param attr The desired attribute; one of UCAL_LENIENT, UCAL_FIRST_DAY_OF_WEEK, 934103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * UCAL_MINIMAL_DAYS_IN_FIRST_WEEK, UCAL_REPEATED_WALL_TIME or UCAL_SKIPPED_WALL_TIME 935b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The value of attr. 936b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setAttribute 937b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 938b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 939b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE int32_t U_EXPORT2 940b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_getAttribute(const UCalendar* cal, 941b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarAttribute attr); 942b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 943b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 944b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set a numeric attribute associated with a UCalendar. 945b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Numeric attributes include the first day of the week, or the minimal numbers 946b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * of days in the first week of the month. 947b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to set. 948b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param attr The desired attribute; one of UCAL_LENIENT, UCAL_FIRST_DAY_OF_WEEK, 949103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * UCAL_MINIMAL_DAYS_IN_FIRST_WEEK, UCAL_REPEATED_WALL_TIME or UCAL_SKIPPED_WALL_TIME 950b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param newValue The new value of attr. 951b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_getAttribute 952b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 953b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 954b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 955b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_setAttribute(UCalendar* cal, 956b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarAttribute attr, 957b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t newValue); 958b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 959b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 960b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Get a locale for which calendars are available. 961b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * A UCalendar in a locale returned by this function will contain the correct 962b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * day and month names for the locale. 963b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param localeIndex The index of the desired locale. 964b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return A locale for which calendars are available, or 0 if none. 965b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_countAvailable 966b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 967b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 968b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE const char* U_EXPORT2 969b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queruucal_getAvailable(int32_t localeIndex); 970b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 971b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 972b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Determine how many locales have calendars available. 973b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This function is most useful as determining the loop ending condition for 974b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * calls to \ref ucal_getAvailable. 975b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The number of locales for which calendars are available. 976b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_getAvailable 977b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 978b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 979b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE int32_t U_EXPORT2 980b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_countAvailable(void); 981b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 982b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 983b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Get a UCalendar's current time in millis. 984b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The time is represented as milliseconds from the epoch. 985b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to query. 986b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 987b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The calendar's current time in millis. 988b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setMillis 989b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setDate 990b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setDateTime 991b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 992b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 993b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UDate U_EXPORT2 994b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_getMillis(const UCalendar* cal, 995b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status); 996b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 997b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 998b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set a UCalendar's current time in millis. 999b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The time is represented as milliseconds from the epoch. 1000b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to set. 1001b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param dateTime The desired date and time. 1002b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 1003b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_getMillis 1004b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setDate 1005b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setDateTime 1006b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1007b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1008b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 1009b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_setMillis(UCalendar* cal, 1010b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UDate dateTime, 1011b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status ); 1012b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1013b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1014b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set a UCalendar's current date. 1015b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The date is represented as a series of 32-bit integers. 1016b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to set. 1017b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param year The desired year. 1018b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param month The desired month; one of UCAL_JANUARY, UCAL_FEBRUARY, UCAL_MARCH, UCAL_APRIL, UCAL_MAY, 1019b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_JUNE, UCAL_JULY, UCAL_AUGUST, UCAL_SEPTEMBER, UCAL_OCTOBER, UCAL_NOVEMBER, UCAL_DECEMBER, UCAL_UNDECIMBER 1020b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param date The desired day of the month. 1021b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 1022b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_getMillis 1023b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setMillis 1024b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setDateTime 1025b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1026b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1027b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 1028b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_setDate(UCalendar* cal, 1029b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t year, 1030b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t month, 1031b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t date, 1032b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status); 1033b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1034b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1035b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set a UCalendar's current date. 1036b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The date is represented as a series of 32-bit integers. 1037b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to set. 1038b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param year The desired year. 1039b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param month The desired month; one of UCAL_JANUARY, UCAL_FEBRUARY, UCAL_MARCH, UCAL_APRIL, UCAL_MAY, 1040b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_JUNE, UCAL_JULY, UCAL_AUGUST, UCAL_SEPTEMBER, UCAL_OCTOBER, UCAL_NOVEMBER, UCAL_DECEMBER, UCAL_UNDECIMBER 1041b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param date The desired day of the month. 1042b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param hour The desired hour of day. 1043b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param minute The desired minute. 1044b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param second The desirec second. 1045b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 1046b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_getMillis 1047b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setMillis 1048b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setDate 1049b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1050b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1051b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 1052b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_setDateTime(UCalendar* cal, 1053b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t year, 1054b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t month, 1055b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t date, 1056b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t hour, 1057b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t minute, 1058b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t second, 1059b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status); 1060b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1061b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1062b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns TRUE if two UCalendars are equivalent. Equivalent 1063b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCalendars will behave identically, but they may be set to 1064b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * different times. 1065b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal1 The first of the UCalendars to compare. 1066b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal2 The second of the UCalendars to compare. 1067b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return TRUE if cal1 and cal2 are equivalent, FALSE otherwise. 1068b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1069b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1070b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UBool U_EXPORT2 1071b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_equivalentTo(const UCalendar* cal1, 1072b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru const UCalendar* cal2); 1073b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1074b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1075b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Add a specified signed amount to a particular field in a UCalendar. 1076b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This can modify more significant fields in the calendar. 107754dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * Adding a positive value always means moving forward in time, so for the Gregorian calendar, 107854dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * starting with 100 BC and adding +1 to year results in 99 BC (even though this actually reduces 107954dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * the numeric value of the field itself). 1080b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to which to add. 1081b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param field The field to which to add the signed value; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH, 1082b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK, 1083b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND, 1084b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET. 1085b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param amount The signed amount to add to field. If the amount causes the value 1086b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to exceed to maximum or minimum values for that field, other fields are modified 1087b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to preserve the magnitude of the change. 1088b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 1089b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_roll 1090b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1091b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1092b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 1093b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_add(UCalendar* cal, 1094b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarDateFields field, 1095b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t amount, 1096b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status); 1097b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1098b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1099b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Add a specified signed amount to a particular field in a UCalendar. 1100b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This will not modify more significant fields in the calendar. 110154dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * Rolling by a positive value always means moving forward in time (unless the limit of the 110254dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * field is reached, in which case it may pin or wrap), so for Gregorian calendar, 110354dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * starting with 100 BC and rolling the year by +1 results in 99 BC. 110454dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * When eras have a definite beginning and end (as in the Chinese calendar, or as in most eras in the 110554dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * Japanese calendar) then rolling the year past either limit of the era will cause the year to wrap around. 110654dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * When eras only have a limit at one end, then attempting to roll the year past that limit will result in 110754dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * pinning the year at that limit. Note that for most calendars in which era 0 years move forward in time 110854dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * (such as Buddhist, Hebrew, or Islamic), it is possible for add or roll to result in negative years for 110954dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * era 0 (that is the only way to represent years before the calendar epoch). 1110b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to which to add. 1111b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param field The field to which to add the signed value; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH, 1112b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK, 1113b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND, 1114b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET. 1115b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param amount The signed amount to add to field. If the amount causes the value 1116b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to exceed to maximum or minimum values for that field, the field is pinned to a permissible 1117b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * value. 1118b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 1119b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_add 1120b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1121b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1122b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 1123b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_roll(UCalendar* cal, 1124b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarDateFields field, 1125b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t amount, 1126b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status); 1127b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1128b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1129b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Get the current value of a field from a UCalendar. 1130b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * All fields are represented as 32-bit integers. 1131b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to query. 1132b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param field The desired field; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH, 1133b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK, 1134b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND, 1135b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET. 1136b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 1137b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The value of the desired field. 1138b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_set 1139b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_isSet 1140b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_clearField 1141b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_clear 1142b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1143b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1144b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE int32_t U_EXPORT2 1145b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_get(const UCalendar* cal, 1146b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarDateFields field, 1147b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status ); 1148b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1149b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1150b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set the value of a field in a UCalendar. 1151b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * All fields are represented as 32-bit integers. 1152b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to set. 1153b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param field The field to set; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH, 1154b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK, 1155b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND, 1156b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET. 1157b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param value The desired value of field. 1158b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_get 1159b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_isSet 1160b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_clearField 1161b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_clear 1162b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1163b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1164b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 1165b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_set(UCalendar* cal, 1166b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarDateFields field, 1167b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t value); 1168b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1169b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1170b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Determine if a field in a UCalendar is set. 1171b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * All fields are represented as 32-bit integers. 1172b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to query. 1173b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param field The desired field; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH, 1174b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK, 1175b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND, 1176b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET. 1177b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return TRUE if field is set, FALSE otherwise. 1178b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_get 1179b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_set 1180b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_clearField 1181b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_clear 1182b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1183b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1184b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UBool U_EXPORT2 1185b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_isSet(const UCalendar* cal, 1186b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarDateFields field); 1187b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1188b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1189b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Clear a field in a UCalendar. 1190b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * All fields are represented as 32-bit integers. 1191b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar containing the field to clear. 1192b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param field The field to clear; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH, 1193b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK, 1194b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND, 1195b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET. 1196b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_get 1197b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_set 1198b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_isSet 1199b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_clear 1200b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1201b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1202b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 1203b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_clearField(UCalendar* cal, 1204b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarDateFields field); 1205b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1206b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1207b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Clear all fields in a UCalendar. 1208b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * All fields are represented as 32-bit integers. 1209b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param calendar The UCalendar to clear. 1210b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_get 1211b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_set 1212b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_isSet 1213b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_clearField 1214b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1215b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1216b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 1217b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_clear(UCalendar* calendar); 1218b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1219b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1220b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Possible limit values for a UCalendar 1221b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1222b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1223b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruenum UCalendarLimitType { 1224b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Minimum value */ 1225b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_MINIMUM, 1226b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Maximum value */ 1227b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_MAXIMUM, 1228b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Greatest minimum value */ 1229b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_GREATEST_MINIMUM, 1230b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Leaest maximum value */ 1231b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_LEAST_MAXIMUM, 1232b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Actual minimum value */ 1233b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_ACTUAL_MINIMUM, 1234b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Actual maximum value */ 1235b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_ACTUAL_MAXIMUM 1236b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}; 1237b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1238b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** @stable ICU 2.0 */ 1239b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querutypedef enum UCalendarLimitType UCalendarLimitType; 1240b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1241b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1242b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Determine a limit for a field in a UCalendar. 1243b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * A limit is a maximum or minimum value for a field. 1244b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to query. 1245b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param field The desired field; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH, 1246b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK, 1247b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND, 1248b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET. 1249b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param type The desired critical point; one of UCAL_MINIMUM, UCAL_MAXIMUM, UCAL_GREATEST_MINIMUM, 1250b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_LEAST_MAXIMUM, UCAL_ACTUAL_MINIMUM, UCAL_ACTUAL_MAXIMUM 1251b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors. 1252b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The requested value. 1253b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1254b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1255b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE int32_t U_EXPORT2 1256b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_getLimit(const UCalendar* cal, 1257b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarDateFields field, 1258b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarLimitType type, 1259b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status); 1260b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1261b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Get the locale for this calendar object. You can choose between valid and actual locale. 1262b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The calendar object 1263b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param type type of the locale we're looking for (valid or actual) 1264b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status error code for the operation 1265b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return the locale name 1266b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.8 1267b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1268b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE const char * U_EXPORT2 1269b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_getLocaleByType(const UCalendar *cal, ULocDataLocaleType type, UErrorCode* status); 1270b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1271b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1272b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns the timezone data version currently used by ICU. 1273b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status error code for the operation 1274b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return the version string, such as "2007f" 1275b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @stable ICU 3.8 1276b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 127750294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoU_STABLE const char * U_EXPORT2 1278b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_getTZDataVersion(UErrorCode* status); 1279b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1280c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru/** 1281c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * Returns the canonical system timezone ID or the normalized 1282c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * custom time zone ID for the given time zone ID. 1283c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * @param id The input timezone ID to be canonicalized. 1284c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * @param len The length of id, or -1 if null-terminated. 1285c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * @param result The buffer receives the canonical system timezone ID 1286c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * or the custom timezone ID in normalized format. 1287c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * @param resultCapacity The capacity of the result buffer. 1288c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * @param isSystemID Receives if the given ID is a known system 1289c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * timezone ID. 1290fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param status Receives the status. When the given timezone ID 1291c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * is neither a known system time zone ID nor a 1292c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * valid custom timezone ID, U_ILLEGAL_ARGUMENT_ERROR 1293c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * is set. 1294c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * @return The result string length, not including the terminating 1295c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * null. 1296b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @stable ICU 4.0 1297c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru */ 129850294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoU_STABLE int32_t U_EXPORT2 1299c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queruucal_getCanonicalTimeZoneID(const UChar* id, int32_t len, 1300c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru UChar* result, int32_t resultCapacity, UBool *isSystemID, UErrorCode* status); 1301b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/** 1302b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Get the resource keyword value string designating the calendar type for the UCalendar. 1303b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param cal The UCalendar to query. 1304b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param status The error code for the operation. 1305b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @return The resource keyword value string. 130650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @stable ICU 4.2 1307b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */ 130850294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoU_STABLE const char * U_EXPORT2 1309b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queruucal_getType(const UCalendar *cal, UErrorCode* status); 1310b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru 1311b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/** 1312b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Given a key and a locale, returns an array of string values in a preferred 1313b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * order that would make a difference. These are all and only those values where 1314b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * the open (creation) of the service with the locale formed from the input locale 1315b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * plus input keyword and that value has different behavior than creation with the 1316b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * input locale alone. 1317b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param key one of the keys supported by this service. For now, only 1318b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * "calendar" is supported. 1319b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param locale the locale 1320b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param commonlyUsed if set to true it will return only commonly used values 1321b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * with the given locale in preferred order. Otherwise, 1322b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * it will return all the available values for the locale. 1323b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param status error status 1324b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @return a string enumeration over keyword values for the given key and the locale. 132550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @stable ICU 4.2 1326b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */ 132750294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoU_STABLE UEnumeration* U_EXPORT2 1328b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queruucal_getKeywordValuesForLocale(const char* key, 1329b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru const char* locale, 1330b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru UBool commonlyUsed, 1331b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru UErrorCode* status); 1332b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru 1333b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru 133450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/** Weekday types, as returned by ucal_getDayOfWeekType(). 133527f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4 133650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 133750294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoenum UCalendarWeekdayType { 133850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho /** 133950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Designates a full weekday (no part of the day is included in the weekend). 134027f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4 134150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 134250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho UCAL_WEEKDAY, 134350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho /** 134450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Designates a full weekend day (the entire day is included in the weekend). 134527f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4 134650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 134750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho UCAL_WEEKEND, 134850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho /** 134950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Designates a day that starts as a weekday and transitions to the weekend. 135050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Call ucal_getWeekendTransition() to get the time of transition. 135127f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4 135250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 135350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho UCAL_WEEKEND_ONSET, 135450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho /** 135550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Designates a day that starts as the weekend and transitions to a weekday. 135650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Call ucal_getWeekendTransition() to get the time of transition. 135727f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4 135850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 135950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho UCAL_WEEKEND_CEASE 136050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho}; 136150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho 136227f654740f2a26ad62a5c155af9199af9e69b889claireho/** @stable ICU 4.4 */ 136350294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehotypedef enum UCalendarWeekdayType UCalendarWeekdayType; 136450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho 136550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/** 136659d709d503bab6e2b61931737e662dd293b40578ccornelius * Returns whether the given day of the week is a weekday, a weekend day, 136759d709d503bab6e2b61931737e662dd293b40578ccornelius * or a day that transitions from one to the other, for the locale and 136859d709d503bab6e2b61931737e662dd293b40578ccornelius * calendar system associated with this UCalendar (the locale's region is 136959d709d503bab6e2b61931737e662dd293b40578ccornelius * often the most determinant factor). If a transition occurs at midnight, 137050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * then the days before and after the transition will have the 137150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * type UCAL_WEEKDAY or UCAL_WEEKEND. If a transition occurs at a time 137250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * other than midnight, then the day of the transition will have 137350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * the type UCAL_WEEKEND_ONSET or UCAL_WEEKEND_CEASE. In this case, the 137459d709d503bab6e2b61931737e662dd293b40578ccornelius * function ucal_getWeekendTransition() will return the point of 137550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * transition. 137650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param cal The UCalendar to query. 137750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param dayOfWeek The day of the week whose type is desired (UCAL_SUNDAY..UCAL_SATURDAY). 137850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param status The error code for the operation. 137950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @return The UCalendarWeekdayType for the day of the week. 138027f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4 138150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 138227f654740f2a26ad62a5c155af9199af9e69b889clairehoU_STABLE UCalendarWeekdayType U_EXPORT2 138350294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoucal_getDayOfWeekType(const UCalendar *cal, UCalendarDaysOfWeek dayOfWeek, UErrorCode* status); 138450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho 138550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/** 138650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Returns the time during the day at which the weekend begins or ends in 138759d709d503bab6e2b61931737e662dd293b40578ccornelius * this calendar system. If ucal_getDayOfWeekType() returns UCAL_WEEKEND_ONSET 138850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * for the specified dayOfWeek, return the time at which the weekend begins. 138950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * If ucal_getDayOfWeekType() returns UCAL_WEEKEND_CEASE for the specified dayOfWeek, 139050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * return the time at which the weekend ends. If ucal_getDayOfWeekType() returns 139150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * some other UCalendarWeekdayType for the specified dayOfWeek, is it an error condition 139250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * (U_ILLEGAL_ARGUMENT_ERROR). 139350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param cal The UCalendar to query. 139450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param dayOfWeek The day of the week for which the weekend transition time is 139550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * desired (UCAL_SUNDAY..UCAL_SATURDAY). 139650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param status The error code for the operation. 139750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @return The milliseconds after midnight at which the weekend begins or ends. 139827f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4 139950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 140027f654740f2a26ad62a5c155af9199af9e69b889clairehoU_STABLE int32_t U_EXPORT2 140150294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoucal_getWeekendTransition(const UCalendar *cal, UCalendarDaysOfWeek dayOfWeek, UErrorCode *status); 140250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho 140350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/** 140450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Returns TRUE if the given UDate is in the weekend in 140550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * this calendar system. 140650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param cal The UCalendar to query. 140750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param date The UDate in question. 140850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param status The error code for the operation. 140950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @return TRUE if the given UDate is in the weekend in 141050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * this calendar system, FALSE otherwise. 141127f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4 141250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 141327f654740f2a26ad62a5c155af9199af9e69b889clairehoU_STABLE UBool U_EXPORT2 141450294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoucal_isWeekend(const UCalendar *cal, UDate date, UErrorCode *status); 141550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho 1416b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho/** 1417b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * Return the difference between the target time and the time this calendar object is currently set to. 1418b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * If the target time is after the current calendar setting, the the returned value will be positive. 1419b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * The field parameter specifies the units of the return value. For example, if field is UCAL_MONTH 1420b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * and ucal_getFieldDifference returns 3, then the target time is 3 to less than 4 months after the 1421b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * current calendar setting. 1422b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * 1423b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * As a side effect of this call, this calendar is advanced toward target by the given amount. That is, 1424b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * calling this function has the side effect of calling ucal_add on this calendar with the specified 1425b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * field and an amount equal to the return value from this function. 1426b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * 1427b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * A typical way of using this function is to call it first with the largest field of interest, then 1428b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * with progressively smaller fields. 1429b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * 1430b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @param cal The UCalendar to compare and update. 1431b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @param target The target date to compare to the current calendar setting. 1432b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @param field The field to compare; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH, 1433b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK, 1434b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND, 1435b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET. 1436b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @param status A pointer to an UErrorCode to receive any errors 1437b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @return The date difference for the specified field. 1438103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * @stable ICU 4.8 1439b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho */ 144054dcd9b6a06071f647dac967e9e267abb9410720Craig CorneliusU_STABLE int32_t U_EXPORT2 1441b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2clairehoucal_getFieldDifference(UCalendar* cal, 1442b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho UDate target, 1443b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho UCalendarDateFields field, 1444b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho UErrorCode* status); 1445b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho 144654dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius/** 144754dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * Time zone transition types for ucal_getTimeZoneTransitionDate 144859d709d503bab6e2b61931737e662dd293b40578ccornelius * @stable ICU 50 144954dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius */ 145054dcd9b6a06071f647dac967e9e267abb9410720Craig Corneliusenum UTimeZoneTransitionType { 145154dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius /** 145254dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * Get the next transition after the current date, 145354dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * i.e. excludes the current date 145459d709d503bab6e2b61931737e662dd293b40578ccornelius * @stable ICU 50 145554dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius */ 145654dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius UCAL_TZ_TRANSITION_NEXT, 145754dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius /** 145854dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * Get the next transition on or after the current date, 145954dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * i.e. may include the current date 146059d709d503bab6e2b61931737e662dd293b40578ccornelius * @stable ICU 50 146154dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius */ 146254dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius UCAL_TZ_TRANSITION_NEXT_INCLUSIVE, 146354dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius /** 146454dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * Get the previous transition before the current date, 146554dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * i.e. excludes the current date 146659d709d503bab6e2b61931737e662dd293b40578ccornelius * @stable ICU 50 146754dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius */ 146854dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius UCAL_TZ_TRANSITION_PREVIOUS, 146954dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius /** 147054dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * Get the previous transition on or before the current date, 147154dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * i.e. may include the current date 147259d709d503bab6e2b61931737e662dd293b40578ccornelius * @stable ICU 50 147354dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius */ 147454dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius UCAL_TZ_TRANSITION_PREVIOUS_INCLUSIVE 147554dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius}; 147654dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius 147759d709d503bab6e2b61931737e662dd293b40578ccorneliustypedef enum UTimeZoneTransitionType UTimeZoneTransitionType; /**< @stable ICU 50 */ 147854dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius 147954dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius/** 148054dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius* Get the UDate for the next/previous time zone transition relative to 148154dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius* the calendar's current date, in the time zone to which the calendar 148254dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius* is currently set. If there is no known time zone transition of the 148354dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius* requested type relative to the calendar's date, the function returns 148454dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius* FALSE. 148554dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius* @param cal The UCalendar to query. 148654dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius* @param type The type of transition desired. 148754dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius* @param transition A pointer to a UDate to be set to the transition time. 148854dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius* If the function returns FALSE, the value set is unspecified. 148954dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius* @param status A pointer to a UErrorCode to receive any errors. 149054dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius* @return TRUE if a valid transition time is set in *transition, FALSE 149154dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius* otherwise. 149259d709d503bab6e2b61931737e662dd293b40578ccornelius* @stable ICU 50 149354dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius*/ 149454dcd9b6a06071f647dac967e9e267abb9410720Craig CorneliusU_DRAFT UBool U_EXPORT2 149554dcd9b6a06071f647dac967e9e267abb9410720Craig Corneliusucal_getTimeZoneTransitionDate(const UCalendar* cal, UTimeZoneTransitionType type, 149654dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius UDate* transition, UErrorCode* status); 149754dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius 149859d709d503bab6e2b61931737e662dd293b40578ccornelius#ifndef U_HIDE_DRAFT_API 149959d709d503bab6e2b61931737e662dd293b40578ccornelius/** 150059d709d503bab6e2b61931737e662dd293b40578ccornelius* Converts a system time zone ID to an equivalent Windows time zone ID. For example, 150159d709d503bab6e2b61931737e662dd293b40578ccornelius* Windows time zone ID "Pacific Standard Time" is returned for input "America/Los_Angeles". 150259d709d503bab6e2b61931737e662dd293b40578ccornelius* 150359d709d503bab6e2b61931737e662dd293b40578ccornelius* <p>There are system time zones that cannot be mapped to Windows zones. When the input 150459d709d503bab6e2b61931737e662dd293b40578ccornelius* system time zone ID is unknown or unmappable to a Windows time zone, then this 150559d709d503bab6e2b61931737e662dd293b40578ccornelius* function returns 0 as the result length, but the operation itself remains successful 150659d709d503bab6e2b61931737e662dd293b40578ccornelius* (no error status set on return). 150759d709d503bab6e2b61931737e662dd293b40578ccornelius* 150859d709d503bab6e2b61931737e662dd293b40578ccornelius* <p>This implementation utilizes <a href="http://unicode.org/cldr/charts/supplemental/zone_tzid.html"> 150959d709d503bab6e2b61931737e662dd293b40578ccornelius* Zone-Tzid mapping data</a>. The mapping data is updated time to time. To get the latest changes, 151059d709d503bab6e2b61931737e662dd293b40578ccornelius* please read the ICU user guide section <a href="http://userguide.icu-project.org/datetime/timezone#TOC-Updating-the-Time-Zone-Data"> 151159d709d503bab6e2b61931737e662dd293b40578ccornelius* Updating the Time Zone Data</a>. 151259d709d503bab6e2b61931737e662dd293b40578ccornelius* 151359d709d503bab6e2b61931737e662dd293b40578ccornelius* @param id A system time zone ID. 151459d709d503bab6e2b61931737e662dd293b40578ccornelius* @param len The length of <code>id</code>, or -1 if null-terminated. 151559d709d503bab6e2b61931737e662dd293b40578ccornelius* @param winid A buffer to receive a Windows time zone ID. 151659d709d503bab6e2b61931737e662dd293b40578ccornelius* @param winidCapacity The capacity of the result buffer <code>winid</code>. 151759d709d503bab6e2b61931737e662dd293b40578ccornelius* @param status Receives the status. 151859d709d503bab6e2b61931737e662dd293b40578ccornelius* @return The result string length, not including the terminating null. 151959d709d503bab6e2b61931737e662dd293b40578ccornelius* @see ucal_getTimeZoneIDForWindowsID 152059d709d503bab6e2b61931737e662dd293b40578ccornelius* 152159d709d503bab6e2b61931737e662dd293b40578ccornelius* @draft ICU 52 152259d709d503bab6e2b61931737e662dd293b40578ccornelius*/ 152359d709d503bab6e2b61931737e662dd293b40578ccorneliusU_DRAFT int32_t U_EXPORT2 152459d709d503bab6e2b61931737e662dd293b40578ccorneliusucal_getWindowsTimeZoneID(const UChar* id, int32_t len, 152559d709d503bab6e2b61931737e662dd293b40578ccornelius UChar* winid, int32_t winidCapacity, UErrorCode* status); 152659d709d503bab6e2b61931737e662dd293b40578ccornelius 152759d709d503bab6e2b61931737e662dd293b40578ccornelius/** 152859d709d503bab6e2b61931737e662dd293b40578ccornelius* Converts a Windows time zone ID to an equivalent system time zone ID 152959d709d503bab6e2b61931737e662dd293b40578ccornelius* for a region. For example, system time zone ID "America/Los_Angeles" is returned 153059d709d503bab6e2b61931737e662dd293b40578ccornelius* for input Windows ID "Pacific Standard Time" and region "US" (or <code>null</code>), 153159d709d503bab6e2b61931737e662dd293b40578ccornelius* "America/Vancouver" is returned for the same Windows ID "Pacific Standard Time" and 153259d709d503bab6e2b61931737e662dd293b40578ccornelius* region "CA". 153359d709d503bab6e2b61931737e662dd293b40578ccornelius* 153459d709d503bab6e2b61931737e662dd293b40578ccornelius* <p>Not all Windows time zones can be mapped to system time zones. When the input 153559d709d503bab6e2b61931737e662dd293b40578ccornelius* Windows time zone ID is unknown or unmappable to a system time zone, then this 153659d709d503bab6e2b61931737e662dd293b40578ccornelius* function returns 0 as the result length, but the operation itself remains successful 153759d709d503bab6e2b61931737e662dd293b40578ccornelius* (no error status set on return). 153859d709d503bab6e2b61931737e662dd293b40578ccornelius* 153959d709d503bab6e2b61931737e662dd293b40578ccornelius* <p>This implementation utilizes <a href="http://unicode.org/cldr/charts/supplemental/zone_tzid.html"> 154059d709d503bab6e2b61931737e662dd293b40578ccornelius* Zone-Tzid mapping data</a>. The mapping data is updated time to time. To get the latest changes, 154159d709d503bab6e2b61931737e662dd293b40578ccornelius* please read the ICU user guide section <a href="http://userguide.icu-project.org/datetime/timezone#TOC-Updating-the-Time-Zone-Data"> 154259d709d503bab6e2b61931737e662dd293b40578ccornelius* Updating the Time Zone Data</a>. 154359d709d503bab6e2b61931737e662dd293b40578ccornelius* 154459d709d503bab6e2b61931737e662dd293b40578ccornelius* @param winid A Windows time zone ID. 154559d709d503bab6e2b61931737e662dd293b40578ccornelius* @param len The length of <code>winid</code>, or -1 if null-terminated. 154659d709d503bab6e2b61931737e662dd293b40578ccornelius* @param region A null-terminated region code, or <code>NULL</code> if no regional preference. 154759d709d503bab6e2b61931737e662dd293b40578ccornelius* @param id A buffer to receive a system time zone ID. 154859d709d503bab6e2b61931737e662dd293b40578ccornelius* @param idCapacity The capacity of the result buffer <code>id</code>. 154959d709d503bab6e2b61931737e662dd293b40578ccornelius* @param status Receives the status. 155059d709d503bab6e2b61931737e662dd293b40578ccornelius* @return The result string length, not including the terminating null. 155159d709d503bab6e2b61931737e662dd293b40578ccornelius* @see ucal_getWindowsTimeZoneID 155259d709d503bab6e2b61931737e662dd293b40578ccornelius* 155359d709d503bab6e2b61931737e662dd293b40578ccornelius* @draft ICU 52 155459d709d503bab6e2b61931737e662dd293b40578ccornelius*/ 155559d709d503bab6e2b61931737e662dd293b40578ccorneliusU_DRAFT int32_t U_EXPORT2 155659d709d503bab6e2b61931737e662dd293b40578ccorneliusucal_getTimeZoneIDForWindowsID(const UChar* winid, int32_t len, const char* region, 155759d709d503bab6e2b61931737e662dd293b40578ccornelius UChar* id, int32_t idCapacity, UErrorCode* status); 155859d709d503bab6e2b61931737e662dd293b40578ccornelius 155954dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius#endif /* U_HIDE_DRAFT_API */ 156054dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius 1561b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif /* #if !UCONFIG_NO_FORMATTING */ 1562b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1563b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif 1564