From f8efff95be899f0e10e2ba079958ead670ddb545 Mon Sep 17 00:00:00 2001 From: Yoshito Umaoka Date: Sat, 21 Mar 2009 08:21:33 +0000 Subject: [PATCH] ICU-5699 Updated out of date US DST rule descriptions in API doc. X-SVN-Rev: 25642 --- icu4c/source/i18n/unicode/gregocal.h | 82 ++++++++++++++-------------- icu4c/source/i18n/unicode/simpletz.h | 24 ++++---- 2 files changed, 53 insertions(+), 53 deletions(-) diff --git a/icu4c/source/i18n/unicode/gregocal.h b/icu4c/source/i18n/unicode/gregocal.h index f2d1b0b17d..c17b6fe97d 100644 --- a/icu4c/source/i18n/unicode/gregocal.h +++ b/icu4c/source/i18n/unicode/gregocal.h @@ -1,5 +1,5 @@ /* -* Copyright (C) 1997-2006, International Business Machines Corporation and others. +* Copyright (C) 1997-2009, International Business Machines Corporation and others. * All Rights Reserved. ******************************************************************************** * @@ -87,54 +87,54 @@ U_NAMESPACE_BEGIN * SimpleTimeZone* pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids->unext(NULL, success))); * * // set up rules for daylight savings time - * pdt->setStartRule(Calendar::APRIL, 1, Calendar::SUNDAY, 2 * 60 * 60 * 1000); - * pdt->setEndRule(Calendar::OCTOBER, -1, Calendar::SUNDAY, 2 * 60 * 60 * 1000); + * pdt->setStartRule(UCAL_MARCH, 1, UCAL_SUNDAY, 2 * 60 * 60 * 1000); + * pdt->setEndRule(UCAL_NOVEMBER, 2, UCAL_SUNDAY, 2 * 60 * 60 * 1000); * * // create a GregorianCalendar with the Pacific Daylight time zone * // and the current date and time * Calendar* calendar = new GregorianCalendar( pdt, success ); * * // print out a bunch of interesting things - * cout << "ERA: " << calendar->get( Calendar::ERA, success ) << endl; - * cout << "YEAR: " << calendar->get( Calendar::YEAR, success ) << endl; - * cout << "MONTH: " << calendar->get( Calendar::MONTH, success ) << endl; - * cout << "WEEK_OF_YEAR: " << calendar->get( Calendar::WEEK_OF_YEAR, success ) << endl; - * cout << "WEEK_OF_MONTH: " << calendar->get( Calendar::WEEK_OF_MONTH, success ) << endl; - * cout << "DATE: " << calendar->get( Calendar::DATE, success ) << endl; - * cout << "DAY_OF_MONTH: " << calendar->get( Calendar::DAY_OF_MONTH, success ) << endl; - * cout << "DAY_OF_YEAR: " << calendar->get( Calendar::DAY_OF_YEAR, success ) << endl; - * cout << "DAY_OF_WEEK: " << calendar->get( Calendar::DAY_OF_WEEK, success ) << endl; - * cout << "DAY_OF_WEEK_IN_MONTH: " << calendar->get( Calendar::DAY_OF_WEEK_IN_MONTH, success ) << endl; - * cout << "AM_PM: " << calendar->get( Calendar::AM_PM, success ) << endl; - * cout << "HOUR: " << calendar->get( Calendar::HOUR, success ) << endl; - * cout << "HOUR_OF_DAY: " << calendar->get( Calendar::HOUR_OF_DAY, success ) << endl; - * cout << "MINUTE: " << calendar->get( Calendar::MINUTE, success ) << endl; - * cout << "SECOND: " << calendar->get( Calendar::SECOND, success ) << endl; - * cout << "MILLISECOND: " << calendar->get( Calendar::MILLISECOND, success ) << endl; - * cout << "ZONE_OFFSET: " << (calendar->get( Calendar::ZONE_OFFSET, success )/(60*60*1000)) << endl; - * cout << "DST_OFFSET: " << (calendar->get( Calendar::DST_OFFSET, success )/(60*60*1000)) << endl; + * cout << "ERA: " << calendar->get( UCAL_ERA, success ) << endl; + * cout << "YEAR: " << calendar->get( UCAL_YEAR, success ) << endl; + * cout << "MONTH: " << calendar->get( UCAL_MONTH, success ) << endl; + * cout << "WEEK_OF_YEAR: " << calendar->get( UCAL_WEEK_OF_YEAR, success ) << endl; + * cout << "WEEK_OF_MONTH: " << calendar->get( UCAL_WEEK_OF_MONTH, success ) << endl; + * cout << "DATE: " << calendar->get( UCAL_DATE, success ) << endl; + * cout << "DAY_OF_MONTH: " << calendar->get( UCAL_DAY_OF_MONTH, success ) << endl; + * cout << "DAY_OF_YEAR: " << calendar->get( UCAL_DAY_OF_YEAR, success ) << endl; + * cout << "DAY_OF_WEEK: " << calendar->get( UCAL_DAY_OF_WEEK, success ) << endl; + * cout << "DAY_OF_WEEK_IN_MONTH: " << calendar->get( UCAL_DAY_OF_WEEK_IN_MONTH, success ) << endl; + * cout << "AM_PM: " << calendar->get( UCAL_AM_PM, success ) << endl; + * cout << "HOUR: " << calendar->get( UCAL_HOUR, success ) << endl; + * cout << "HOUR_OF_DAY: " << calendar->get( UCAL_HOUR_OF_DAY, success ) << endl; + * cout << "MINUTE: " << calendar->get( UCAL_MINUTE, success ) << endl; + * cout << "SECOND: " << calendar->get( UCAL_SECOND, success ) << endl; + * cout << "MILLISECOND: " << calendar->get( UCAL_MILLISECOND, success ) << endl; + * cout << "ZONE_OFFSET: " << (calendar->get( UCAL_ZONE_OFFSET, success )/(60*60*1000)) << endl; + * cout << "DST_OFFSET: " << (calendar->get( UCAL_DST_OFFSET, success )/(60*60*1000)) << endl; * * cout << "Current Time, with hour reset to 3" << endl; - * calendar->clear(Calendar::HOUR_OF_DAY); // so doesn't override - * calendar->set(Calendar::HOUR, 3); - * cout << "ERA: " << calendar->get( Calendar::ERA, success ) << endl; - * cout << "YEAR: " << calendar->get( Calendar::YEAR, success ) << endl; - * cout << "MONTH: " << calendar->get( Calendar::MONTH, success ) << endl; - * cout << "WEEK_OF_YEAR: " << calendar->get( Calendar::WEEK_OF_YEAR, success ) << endl; - * cout << "WEEK_OF_MONTH: " << calendar->get( Calendar::WEEK_OF_MONTH, success ) << endl; - * cout << "DATE: " << calendar->get( Calendar::DATE, success ) << endl; - * cout << "DAY_OF_MONTH: " << calendar->get( Calendar::DAY_OF_MONTH, success ) << endl; - * cout << "DAY_OF_YEAR: " << calendar->get( Calendar::DAY_OF_YEAR, success ) << endl; - * cout << "DAY_OF_WEEK: " << calendar->get( Calendar::DAY_OF_WEEK, success ) << endl; - * cout << "DAY_OF_WEEK_IN_MONTH: " << calendar->get( Calendar::DAY_OF_WEEK_IN_MONTH, success ) << endl; - * cout << "AM_PM: " << calendar->get( Calendar::AM_PM, success ) << endl; - * cout << "HOUR: " << calendar->get( Calendar::HOUR, success ) << endl; - * cout << "HOUR_OF_DAY: " << calendar->get( Calendar::HOUR_OF_DAY, success ) << endl; - * cout << "MINUTE: " << calendar->get( Calendar::MINUTE, success ) << endl; - * cout << "SECOND: " << calendar->get( Calendar::SECOND, success ) << endl; - * cout << "MILLISECOND: " << calendar->get( Calendar::MILLISECOND, success ) << endl; - * cout << "ZONE_OFFSET: " << (calendar->get( Calendar::ZONE_OFFSET, success )/(60*60*1000)) << endl; // in hours - * cout << "DST_OFFSET: " << (calendar->get( Calendar::DST_OFFSET, success )/(60*60*1000)) << endl; // in hours + * calendar->clear(UCAL_HOUR_OF_DAY); // so doesn't override + * calendar->set(UCAL_HOUR, 3); + * cout << "ERA: " << calendar->get( UCAL_ERA, success ) << endl; + * cout << "YEAR: " << calendar->get( UCAL_YEAR, success ) << endl; + * cout << "MONTH: " << calendar->get( UCAL_MONTH, success ) << endl; + * cout << "WEEK_OF_YEAR: " << calendar->get( UCAL_WEEK_OF_YEAR, success ) << endl; + * cout << "WEEK_OF_MONTH: " << calendar->get( UCAL_WEEK_OF_MONTH, success ) << endl; + * cout << "DATE: " << calendar->get( UCAL_DATE, success ) << endl; + * cout << "DAY_OF_MONTH: " << calendar->get( UCAL_DAY_OF_MONTH, success ) << endl; + * cout << "DAY_OF_YEAR: " << calendar->get( UCAL_DAY_OF_YEAR, success ) << endl; + * cout << "DAY_OF_WEEK: " << calendar->get( UCAL_DAY_OF_WEEK, success ) << endl; + * cout << "DAY_OF_WEEK_IN_MONTH: " << calendar->get( UCAL_DAY_OF_WEEK_IN_MONTH, success ) << endl; + * cout << "AM_PM: " << calendar->get( UCAL_AM_PM, success ) << endl; + * cout << "HOUR: " << calendar->get( UCAL_HOUR, success ) << endl; + * cout << "HOUR_OF_DAY: " << calendar->get( UCAL_HOUR_OF_DAY, success ) << endl; + * cout << "MINUTE: " << calendar->get( UCAL_MINUTE, success ) << endl; + * cout << "SECOND: " << calendar->get( UCAL_SECOND, success ) << endl; + * cout << "MILLISECOND: " << calendar->get( UCAL_MILLISECOND, success ) << endl; + * cout << "ZONE_OFFSET: " << (calendar->get( UCAL_ZONE_OFFSET, success )/(60*60*1000)) << endl; // in hours + * cout << "DST_OFFSET: " << (calendar->get( UCAL_DST_OFFSET, success )/(60*60*1000)) << endl; // in hours * * if (U_FAILURE(success)) { * cout << "An error occured. success=" << u_errorName(success) << endl; diff --git a/icu4c/source/i18n/unicode/simpletz.h b/icu4c/source/i18n/unicode/simpletz.h index 94633da716..871c960586 100644 --- a/icu4c/source/i18n/unicode/simpletz.h +++ b/icu4c/source/i18n/unicode/simpletz.h @@ -1,6 +1,6 @@ /* ******************************************************************************** - * Copyright (C) 1997-2008, International Business Machines * + * Copyright (C) 1997-2009, International Business Machines * * Corporation and others. All Rights Reserved. * ******************************************************************************** * @@ -49,9 +49,9 @@ class AnnualTimeZoneRule; *

* When specifying daylight-savings-time begin and end dates, use a negative value for * dayOfWeekInMonth to indicate that SimpleTimeZone should - * count from the end of the month backwards. For example, in the U.S., Daylight Savings - * Time ends at the last (dayOfWeekInMonth = -1) Sunday in October, at 2 AM in standard - * time. + * count from the end of the month backwards. For example, if Daylight Savings + * Time starts or ends at the last Sunday a month, use dayOfWeekInMonth = -1 + * along with dayOfWeek = UCAL_SUNDAY to specify the rule. * * @see Calendar * @see GregorianCalendar @@ -268,9 +268,9 @@ public: /** * Sets the daylight savings starting rule. For example, in the U.S., Daylight Savings - * Time starts at the first Sunday in April, at 2 AM in standard time. + * Time starts at the second Sunday in March, at 2 AM in standard time. * Therefore, you can set the start rule by calling: - * setStartRule(TimeFields.APRIL, 1, TimeFields.SUNDAY, 2*60*60*1000); + * setStartRule(UCAL_MARCH, 2, UCAL_SUNDAY, 2*60*60*1000); * The dayOfWeekInMonth and dayOfWeek parameters together specify how to calculate * the exact starting date. Their exact meaning depend on their respective signs, * allowing various types of rules to be constructed, as follows: @@ -312,9 +312,9 @@ public: int32_t time, UErrorCode& status); /** * Sets the daylight savings starting rule. For example, in the U.S., Daylight Savings - * Time starts at the first Sunday in April, at 2 AM in standard time. + * Time starts at the second Sunday in March, at 2 AM in standard time. * Therefore, you can set the start rule by calling: - * setStartRule(TimeFields.APRIL, 1, TimeFields.SUNDAY, 2*60*60*1000); + * setStartRule(UCAL_MARCH, 2, UCAL_SUNDAY, 2*60*60*1000); * The dayOfWeekInMonth and dayOfWeek parameters together specify how to calculate * the exact starting date. Their exact meaning depend on their respective signs, * allowing various types of rules to be constructed, as follows: @@ -426,11 +426,11 @@ public: int32_t time, TimeMode mode, UBool after, UErrorCode& status); /** - * Sets the daylight savings ending rule. For example, in the U.S., Daylight + * Sets the daylight savings ending rule. For example, if Daylight * Savings Time ends at the last (-1) Sunday in October, at 2 AM in standard time. * Therefore, you can set the end rule by calling: *

-     * .   setEndRule(TimeFields.OCTOBER, -1, TimeFields.SUNDAY, 2*60*60*1000);
+     *    setEndRule(UCAL_OCTOBER, -1, UCAL_SUNDAY, 2*60*60*1000);
      * 
* Various other types of rules can be specified by manipulating the dayOfWeek * and dayOfWeekInMonth parameters. For complete details, see the documentation @@ -451,11 +451,11 @@ public: int32_t time, UErrorCode& status); /** - * Sets the daylight savings ending rule. For example, in the U.S., Daylight + * Sets the daylight savings ending rule. For example, if Daylight * Savings Time ends at the last (-1) Sunday in October, at 2 AM in standard time. * Therefore, you can set the end rule by calling: *
-     * .   setEndRule(TimeFields.OCTOBER, -1, TimeFields.SUNDAY, 2*60*60*1000);
+     *    setEndRule(UCAL_OCTOBER, -1, UCAL_SUNDAY, 2*60*60*1000);
      * 
* Various other types of rules can be specified by manipulating the dayOfWeek * and dayOfWeekInMonth parameters. For complete details, see the documentation