1b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/* 2b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru ******************************************************************************* 3b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * Copyright (C) 1996-2011, 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 125b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * runtime. Use {@link 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. 145b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @draft 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 528b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @draft ICU 4.8 529b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho */ 530b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2clairehoenum USystemTimeZoneType { 531b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho /** 532b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * Any system zones. 533b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @draft ICU 4.8 534b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho */ 535b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho UCAL_ZONE_TYPE_ANY, 536b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho /** 537b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * Canonical system zones. 538b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @draft ICU 4.8 539b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho */ 540b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho UCAL_ZONE_TYPE_CANONICAL, 541b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho /** 542b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * Canonical system zones associated with actual locations. 543b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @draft ICU 4.8 544b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho */ 545b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho UCAL_ZONE_TYPE_CANONICAL_LOCATION 546b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho}; 547b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho 548b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho/** @draft 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. 565b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @draft ICU 4.8 566b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho */ 567b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2clairehoU_DRAFT 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> 668b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Note: When unknown TimeZone ID is specified, the UCalendar returned 669b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * by the function is initialized with GMT zone with TimeZone ID <code>UCAL_UNKNOWN_ZONE_ID</code> 670b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * ("Etc/Unknown") without any errors/warnings. If you want to check if a TimeZone ID is valid 671b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * 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 748b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 749b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Possible formats for a UCalendar's display name 750b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 751b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 752b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruenum UCalendarDisplayNameType { 753b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Standard display name */ 754b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_STANDARD, 755b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Short standard display name */ 756b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_SHORT_STANDARD, 757b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Daylight savings display name */ 758b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_DST, 759b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Short daylight savings display name */ 760b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_SHORT_DST 761b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}; 762b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 763b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** @stable ICU 2.0 */ 764b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querutypedef enum UCalendarDisplayNameType UCalendarDisplayNameType; 765b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 766b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 767b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Get the display name for a UCalendar's TimeZone. 768b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * A display name is suitable for presentation to a user. 769b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to query. 770b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param type The desired display name format; one of UCAL_STANDARD, UCAL_SHORT_STANDARD, 771b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DST, UCAL_SHORT_DST 772b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param locale The desired locale for the display name. 773b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param result A pointer to a buffer to receive the formatted number. 774b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resultLength The maximum size of result. 775b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 776b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The total buffer size needed; if greater than resultLength, the output was truncated. 777b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 778b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 779b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE int32_t U_EXPORT2 780b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_getTimeZoneDisplayName(const UCalendar* cal, 781b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarDisplayNameType type, 782b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru const char* locale, 783b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UChar* result, 784b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t resultLength, 785b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status); 786b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 787b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 788b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Determine if a UCalendar is currently in daylight savings time. 789b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Daylight savings time is not used in all parts of the world. 790b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to query. 791b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 792b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return TRUE if cal is currently in daylight savings time, FALSE otherwise 793b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 794b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 795b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UBool U_EXPORT2 796b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_inDaylightTime(const UCalendar* cal, 797b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status ); 798b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 799b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 800b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Sets the GregorianCalendar change date. This is the point when the switch from 801b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Julian dates to Gregorian dates occurred. Default is 00:00:00 local time, October 802b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 15, 1582. Previous to this time and date will be Julian dates. 803b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 804b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This function works only for Gregorian calendars. If the UCalendar is not 805b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * an instance of a Gregorian calendar, then a U_UNSUPPORTED_ERROR 806b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * error code is set. 807b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 808b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The calendar object. 809b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param date The given Gregorian cutover date. 810b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param pErrorCode Pointer to a standard ICU error code. Its input value must 811b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * pass the U_SUCCESS() test, or else the function returns 812b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * immediately. Check for U_FAILURE() on output or use with 813b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * function chaining. (See User Guide for details.) 814b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 815b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see GregorianCalendar::setGregorianChange 816b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_getGregorianChange 817b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 3.6 818b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 819b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 820b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_setGregorianChange(UCalendar *cal, UDate date, UErrorCode *pErrorCode); 821b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 822b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 823b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Gets the Gregorian Calendar change date. This is the point when the switch from 824b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Julian dates to Gregorian dates occurred. Default is 00:00:00 local time, October 825b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 15, 1582. Previous to this time and date will be Julian dates. 826b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 827b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This function works only for Gregorian calendars. If the UCalendar is not 828b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * an instance of a Gregorian calendar, then a U_UNSUPPORTED_ERROR 829b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * error code is set. 830b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 831b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The calendar object. 832b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param pErrorCode Pointer to a standard ICU error code. Its input value must 833b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * pass the U_SUCCESS() test, or else the function returns 834b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * immediately. Check for U_FAILURE() on output or use with 835b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * function chaining. (See User Guide for details.) 836b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The Gregorian cutover time for this calendar. 837b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 838b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see GregorianCalendar::getGregorianChange 839b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setGregorianChange 840b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 3.6 841b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 842b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UDate U_EXPORT2 843b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_getGregorianChange(const UCalendar *cal, UErrorCode *pErrorCode); 844b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 845b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 846b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Types of UCalendar attributes 847b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 848b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 849b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruenum UCalendarAttribute { 850b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Lenient parsing */ 851b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_LENIENT, 852b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** First day of week */ 853b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_FIRST_DAY_OF_WEEK, 854b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Minimum number of days in first week */ 855b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_MINIMAL_DAYS_IN_FIRST_WEEK 856b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}; 857b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 858b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** @stable ICU 2.0 */ 859b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querutypedef enum UCalendarAttribute UCalendarAttribute; 860b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 861b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 862b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Get a numeric attribute associated with a UCalendar. 863b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Numeric attributes include the first day of the week, or the minimal numbers 864b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * of days in the first week of the month. 865b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to query. 866b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param attr The desired attribute; one of UCAL_LENIENT, UCAL_FIRST_DAY_OF_WEEK, 867b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * or UCAL_MINIMAL_DAYS_IN_FIRST_WEEK 868b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The value of attr. 869b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setAttribute 870b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 871b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 872b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE int32_t U_EXPORT2 873b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_getAttribute(const UCalendar* cal, 874b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarAttribute attr); 875b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 876b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 877b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set a numeric attribute associated with a UCalendar. 878b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Numeric attributes include the first day of the week, or the minimal numbers 879b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * of days in the first week of the month. 880b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to set. 881b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param attr The desired attribute; one of UCAL_LENIENT, UCAL_FIRST_DAY_OF_WEEK, 882b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * or UCAL_MINIMAL_DAYS_IN_FIRST_WEEK 883b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param newValue The new value of attr. 884b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_getAttribute 885b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 886b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 887b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 888b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_setAttribute(UCalendar* cal, 889b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarAttribute attr, 890b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t newValue); 891b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 892b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 893b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Get a locale for which calendars are available. 894b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * A UCalendar in a locale returned by this function will contain the correct 895b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * day and month names for the locale. 896b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param localeIndex The index of the desired locale. 897b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return A locale for which calendars are available, or 0 if none. 898b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_countAvailable 899b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 900b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 901b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE const char* U_EXPORT2 902b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queruucal_getAvailable(int32_t localeIndex); 903b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 904b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 905b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Determine how many locales have calendars available. 906b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This function is most useful as determining the loop ending condition for 907b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * calls to \ref ucal_getAvailable. 908b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The number of locales for which calendars are available. 909b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_getAvailable 910b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 911b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 912b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE int32_t U_EXPORT2 913b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_countAvailable(void); 914b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 915b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 916b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Get a UCalendar's current time in millis. 917b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The time is represented as milliseconds from the epoch. 918b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to query. 919b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 920b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The calendar's current time in millis. 921b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setMillis 922b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setDate 923b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setDateTime 924b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 925b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 926b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UDate U_EXPORT2 927b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_getMillis(const UCalendar* cal, 928b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status); 929b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 930b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 931b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set a UCalendar's current time in millis. 932b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The time is represented as milliseconds from the epoch. 933b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to set. 934b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param dateTime The desired date and time. 935b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 936b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_getMillis 937b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setDate 938b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setDateTime 939b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 940b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 941b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 942b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_setMillis(UCalendar* cal, 943b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UDate dateTime, 944b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status ); 945b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 946b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 947b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set a UCalendar's current date. 948b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The date is represented as a series of 32-bit integers. 949b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to set. 950b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param year The desired year. 951b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param month The desired month; one of UCAL_JANUARY, UCAL_FEBRUARY, UCAL_MARCH, UCAL_APRIL, UCAL_MAY, 952b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_JUNE, UCAL_JULY, UCAL_AUGUST, UCAL_SEPTEMBER, UCAL_OCTOBER, UCAL_NOVEMBER, UCAL_DECEMBER, UCAL_UNDECIMBER 953b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param date The desired day of the month. 954b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 955b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_getMillis 956b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setMillis 957b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setDateTime 958b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 959b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 960b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 961b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_setDate(UCalendar* cal, 962b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t year, 963b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t month, 964b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t date, 965b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status); 966b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 967b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 968b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set a UCalendar's current date. 969b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The date is represented as a series of 32-bit integers. 970b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to set. 971b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param year The desired year. 972b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param month The desired month; one of UCAL_JANUARY, UCAL_FEBRUARY, UCAL_MARCH, UCAL_APRIL, UCAL_MAY, 973b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_JUNE, UCAL_JULY, UCAL_AUGUST, UCAL_SEPTEMBER, UCAL_OCTOBER, UCAL_NOVEMBER, UCAL_DECEMBER, UCAL_UNDECIMBER 974b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param date The desired day of the month. 975b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param hour The desired hour of day. 976b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param minute The desired minute. 977b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param second The desirec second. 978b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 979b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_getMillis 980b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setMillis 981b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_setDate 982b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 983b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 984b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 985b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_setDateTime(UCalendar* cal, 986b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t year, 987b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t month, 988b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t date, 989b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t hour, 990b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t minute, 991b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t second, 992b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status); 993b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 994b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 995b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns TRUE if two UCalendars are equivalent. Equivalent 996b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCalendars will behave identically, but they may be set to 997b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * different times. 998b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal1 The first of the UCalendars to compare. 999b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal2 The second of the UCalendars to compare. 1000b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return TRUE if cal1 and cal2 are equivalent, FALSE otherwise. 1001b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1002b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1003b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UBool U_EXPORT2 1004b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_equivalentTo(const UCalendar* cal1, 1005b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru const UCalendar* cal2); 1006b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1007b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1008b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Add a specified signed amount to a particular field in a UCalendar. 1009b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This can modify more significant fields in the calendar. 1010b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to which to add. 1011b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param field The field to which to add the signed value; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH, 1012b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK, 1013b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND, 1014b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET. 1015b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param amount The signed amount to add to field. If the amount causes the value 1016b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to exceed to maximum or minimum values for that field, other fields are modified 1017b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to preserve the magnitude of the change. 1018b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 1019b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_roll 1020b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1021b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1022b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 1023b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_add(UCalendar* cal, 1024b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarDateFields field, 1025b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t amount, 1026b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status); 1027b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1028b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1029b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Add a specified signed amount to a particular field in a UCalendar. 1030b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This will not modify more significant fields in the calendar. 1031b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to which to add. 1032b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param field The field to which to add the signed value; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH, 1033b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK, 1034b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND, 1035b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET. 1036b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param amount The signed amount to add to field. If the amount causes the value 1037b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to exceed to maximum or minimum values for that field, the field is pinned to a permissible 1038b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * value. 1039b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 1040b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_add 1041b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1042b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1043b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 1044b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_roll(UCalendar* cal, 1045b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarDateFields field, 1046b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t amount, 1047b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status); 1048b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1049b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1050b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Get the current value of a field from a UCalendar. 1051b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * All fields are represented as 32-bit integers. 1052b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to query. 1053b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param field The desired field; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH, 1054b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK, 1055b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND, 1056b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET. 1057b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors 1058b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The value of the desired field. 1059b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_set 1060b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_isSet 1061b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_clearField 1062b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_clear 1063b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1064b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1065b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE int32_t U_EXPORT2 1066b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_get(const UCalendar* cal, 1067b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarDateFields field, 1068b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status ); 1069b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1070b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1071b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set the value of a field in a UCalendar. 1072b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * All fields are represented as 32-bit integers. 1073b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to set. 1074b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param field The field to set; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH, 1075b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK, 1076b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND, 1077b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET. 1078b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param value The desired value of field. 1079b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_get 1080b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_isSet 1081b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_clearField 1082b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_clear 1083b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1084b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1085b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 1086b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_set(UCalendar* cal, 1087b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarDateFields field, 1088b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t value); 1089b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1090b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1091b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Determine if a field in a UCalendar is set. 1092b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * All fields are represented as 32-bit integers. 1093b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to query. 1094b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param field The desired field; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH, 1095b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK, 1096b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND, 1097b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET. 1098b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return TRUE if field is set, FALSE otherwise. 1099b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_get 1100b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_set 1101b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_clearField 1102b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_clear 1103b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1104b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1105b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UBool U_EXPORT2 1106b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_isSet(const UCalendar* cal, 1107b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarDateFields field); 1108b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1109b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1110b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Clear a field in a UCalendar. 1111b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * All fields are represented as 32-bit integers. 1112b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar containing the field to clear. 1113b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param field The field to clear; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH, 1114b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK, 1115b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND, 1116b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET. 1117b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_get 1118b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_set 1119b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_isSet 1120b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_clear 1121b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1122b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1123b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 1124b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_clearField(UCalendar* cal, 1125b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarDateFields field); 1126b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1127b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1128b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Clear all fields in a UCalendar. 1129b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * All fields are represented as 32-bit integers. 1130b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param calendar The UCalendar to clear. 1131b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_get 1132b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_set 1133b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_isSet 1134b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucal_clearField 1135b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1136b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1137b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 1138b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_clear(UCalendar* calendar); 1139b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1140b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1141b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Possible limit values for a UCalendar 1142b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1143b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1144b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruenum UCalendarLimitType { 1145b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Minimum value */ 1146b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_MINIMUM, 1147b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Maximum value */ 1148b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_MAXIMUM, 1149b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Greatest minimum value */ 1150b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_GREATEST_MINIMUM, 1151b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Leaest maximum value */ 1152b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_LEAST_MAXIMUM, 1153b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Actual minimum value */ 1154b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_ACTUAL_MINIMUM, 1155b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Actual maximum value */ 1156b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCAL_ACTUAL_MAXIMUM 1157b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}; 1158b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1159b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** @stable ICU 2.0 */ 1160b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querutypedef enum UCalendarLimitType UCalendarLimitType; 1161b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1162b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1163b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Determine a limit for a field in a UCalendar. 1164b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * A limit is a maximum or minimum value for a field. 1165b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The UCalendar to query. 1166b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param field The desired field; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH, 1167b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK, 1168b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND, 1169b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET. 1170b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param type The desired critical point; one of UCAL_MINIMUM, UCAL_MAXIMUM, UCAL_GREATEST_MINIMUM, 1171b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UCAL_LEAST_MAXIMUM, UCAL_ACTUAL_MINIMUM, UCAL_ACTUAL_MAXIMUM 1172b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status A pointer to an UErrorCode to receive any errors. 1173b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The requested value. 1174b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 1175b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1176b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE int32_t U_EXPORT2 1177b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_getLimit(const UCalendar* cal, 1178b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarDateFields field, 1179b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UCalendarLimitType type, 1180b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode* status); 1181b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1182b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Get the locale for this calendar object. You can choose between valid and actual locale. 1183b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param cal The calendar object 1184b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param type type of the locale we're looking for (valid or actual) 1185b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status error code for the operation 1186b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return the locale name 1187b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.8 1188b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 1189b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE const char * U_EXPORT2 1190b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_getLocaleByType(const UCalendar *cal, ULocDataLocaleType type, UErrorCode* status); 1191b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1192b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 1193b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns the timezone data version currently used by ICU. 1194b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status error code for the operation 1195b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return the version string, such as "2007f" 1196b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @stable ICU 3.8 1197b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 119850294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoU_STABLE const char * U_EXPORT2 1199b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruucal_getTZDataVersion(UErrorCode* status); 1200b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1201c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru/** 1202c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * Returns the canonical system timezone ID or the normalized 1203c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * custom time zone ID for the given time zone ID. 1204c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * @param id The input timezone ID to be canonicalized. 1205c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * @param len The length of id, or -1 if null-terminated. 1206c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * @param result The buffer receives the canonical system timezone ID 1207c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * or the custom timezone ID in normalized format. 1208c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * @param resultCapacity The capacity of the result buffer. 1209c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * @param isSystemID Receives if the given ID is a known system 1210c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * timezone ID. 1211c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * @param status Recevies the status. When the given timezone ID 1212c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * is neither a known system time zone ID nor a 1213c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * valid custom timezone ID, U_ILLEGAL_ARGUMENT_ERROR 1214c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * is set. 1215c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * @return The result string length, not including the terminating 1216c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * null. 1217b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @stable ICU 4.0 1218c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru */ 121950294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoU_STABLE int32_t U_EXPORT2 1220c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queruucal_getCanonicalTimeZoneID(const UChar* id, int32_t len, 1221c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru UChar* result, int32_t resultCapacity, UBool *isSystemID, UErrorCode* status); 1222b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/** 1223b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Get the resource keyword value string designating the calendar type for the UCalendar. 1224b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param cal The UCalendar to query. 1225b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param status The error code for the operation. 1226b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @return The resource keyword value string. 122750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @stable ICU 4.2 1228b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */ 122950294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoU_STABLE const char * U_EXPORT2 1230b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queruucal_getType(const UCalendar *cal, UErrorCode* status); 1231b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru 1232b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/** 1233b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Given a key and a locale, returns an array of string values in a preferred 1234b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * order that would make a difference. These are all and only those values where 1235b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * the open (creation) of the service with the locale formed from the input locale 1236b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * plus input keyword and that value has different behavior than creation with the 1237b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * input locale alone. 1238b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param key one of the keys supported by this service. For now, only 1239b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * "calendar" is supported. 1240b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param locale the locale 1241b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param commonlyUsed if set to true it will return only commonly used values 1242b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * with the given locale in preferred order. Otherwise, 1243b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * it will return all the available values for the locale. 1244b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param status error status 1245b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @return a string enumeration over keyword values for the given key and the locale. 124650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @stable ICU 4.2 1247b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */ 124850294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoU_STABLE UEnumeration* U_EXPORT2 1249b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queruucal_getKeywordValuesForLocale(const char* key, 1250b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru const char* locale, 1251b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru UBool commonlyUsed, 1252b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru UErrorCode* status); 1253b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru 1254b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru 125550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/** Weekday types, as returned by ucal_getDayOfWeekType(). 125627f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4 125750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 125850294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoenum UCalendarWeekdayType { 125950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho /** 126050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Designates a full weekday (no part of the day is included in the weekend). 126127f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4 126250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 126350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho UCAL_WEEKDAY, 126450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho /** 126550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Designates a full weekend day (the entire day is included in the weekend). 126627f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4 126750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 126850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho UCAL_WEEKEND, 126950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho /** 127050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Designates a day that starts as a weekday and transitions to the weekend. 127150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Call ucal_getWeekendTransition() to get the time of transition. 127227f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4 127350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 127450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho UCAL_WEEKEND_ONSET, 127550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho /** 127650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Designates a day that starts as the weekend and transitions to a weekday. 127750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Call ucal_getWeekendTransition() to get the time of transition. 127827f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4 127950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 128050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho UCAL_WEEKEND_CEASE 128150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho}; 128250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho 128327f654740f2a26ad62a5c155af9199af9e69b889claireho/** @stable ICU 4.4 */ 128450294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehotypedef enum UCalendarWeekdayType UCalendarWeekdayType; 128550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho 128650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/** 128750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Returns whether the given day of the week is a weekday, a 128850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * weekend day, or a day that transitions from one to the other, 128950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * in this calendar system. If a transition occurs at midnight, 129050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * then the days before and after the transition will have the 129150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * type UCAL_WEEKDAY or UCAL_WEEKEND. If a transition occurs at a time 129250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * other than midnight, then the day of the transition will have 129350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * the type UCAL_WEEKEND_ONSET or UCAL_WEEKEND_CEASE. In this case, the 129450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * method getWeekendTransition() will return the point of 129550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * transition. 129650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param cal The UCalendar to query. 129750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param dayOfWeek The day of the week whose type is desired (UCAL_SUNDAY..UCAL_SATURDAY). 129850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param status The error code for the operation. 129950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @return The UCalendarWeekdayType for the day of the week. 130027f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4 130150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 130227f654740f2a26ad62a5c155af9199af9e69b889clairehoU_STABLE UCalendarWeekdayType U_EXPORT2 130350294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoucal_getDayOfWeekType(const UCalendar *cal, UCalendarDaysOfWeek dayOfWeek, UErrorCode* status); 130450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho 130550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/** 130650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Returns the time during the day at which the weekend begins or ends in 130750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * this calendar system. If ucal_getDayOfWeekType() rerturns UCAL_WEEKEND_ONSET 130850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * for the specified dayOfWeek, return the time at which the weekend begins. 130950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * If ucal_getDayOfWeekType() returns UCAL_WEEKEND_CEASE for the specified dayOfWeek, 131050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * return the time at which the weekend ends. If ucal_getDayOfWeekType() returns 131150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * some other UCalendarWeekdayType for the specified dayOfWeek, is it an error condition 131250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * (U_ILLEGAL_ARGUMENT_ERROR). 131350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param cal The UCalendar to query. 131450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param dayOfWeek The day of the week for which the weekend transition time is 131550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * desired (UCAL_SUNDAY..UCAL_SATURDAY). 131650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param status The error code for the operation. 131750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @return The milliseconds after midnight at which the weekend begins or ends. 131827f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4 131950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 132027f654740f2a26ad62a5c155af9199af9e69b889clairehoU_STABLE int32_t U_EXPORT2 132150294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoucal_getWeekendTransition(const UCalendar *cal, UCalendarDaysOfWeek dayOfWeek, UErrorCode *status); 132250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho 132350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/** 132450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Returns TRUE if the given UDate is in the weekend in 132550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * this calendar system. 132650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param cal The UCalendar to query. 132750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param date The UDate in question. 132850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @param status The error code for the operation. 132950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @return TRUE if the given UDate is in the weekend in 133050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * this calendar system, FALSE otherwise. 133127f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4 133250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */ 133327f654740f2a26ad62a5c155af9199af9e69b889clairehoU_STABLE UBool U_EXPORT2 133450294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoucal_isWeekend(const UCalendar *cal, UDate date, UErrorCode *status); 133550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho 1336b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho/** 1337b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * Return the difference between the target time and the time this calendar object is currently set to. 1338b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * If the target time is after the current calendar setting, the the returned value will be positive. 1339b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * The field parameter specifies the units of the return value. For example, if field is UCAL_MONTH 1340b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * and ucal_getFieldDifference returns 3, then the target time is 3 to less than 4 months after the 1341b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * current calendar setting. 1342b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * 1343b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * As a side effect of this call, this calendar is advanced toward target by the given amount. That is, 1344b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * calling this function has the side effect of calling ucal_add on this calendar with the specified 1345b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * field and an amount equal to the return value from this function. 1346b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * 1347b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * A typical way of using this function is to call it first with the largest field of interest, then 1348b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * with progressively smaller fields. 1349b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * 1350b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @param cal The UCalendar to compare and update. 1351b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @param target The target date to compare to the current calendar setting. 1352b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @param field The field to compare; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH, 1353b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK, 1354b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND, 1355b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET. 1356b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @param status A pointer to an UErrorCode to receive any errors 1357b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @return The date difference for the specified field. 1358b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @draft ICU 4.8 1359b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho */ 1360b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2clairehoU_DRAFT int32_t U_EXPORT2 1361b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2clairehoucal_getFieldDifference(UCalendar* cal, 1362b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho UDate target, 1363b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho UCalendarDateFields field, 1364b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho UErrorCode* status); 1365b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho 136650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho 1367b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif /* #if !UCONFIG_NO_FORMATTING */ 1368b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 1369b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif 1370