Logo Search packages:      
Sourcecode: icu version File versions

UBool AnnualTimeZoneRule::getNextStart ( UDate  base,
int32_t  prevRawOffset,
int32_t  prevDSTSavings,
UBool  inclusive,
UDate result 
) const [virtual]

Gets the first time when this rule takes effect after the specified time.

base The first start time after this base time will be returned.
prevRawOffset The standard time offset from UTC before this rule takes effect in milliseconds.
prevDSTSavings The amount of daylight saving offset from the standard time.
inclusive Whether the base time is inclusive or not.
result Receives The first time when this rule takes effect after the specified base time.
true if the start time is available. When false is returned, output parameter "result" is unchanged. ICU 3.8

Implements TimeZoneRule.

Definition at line 351 of file tzrule.cpp.

References FALSE, getFirstStart(), getStartInYear(), Grego::timeToFields(), and TRUE.

Referenced by SimpleTimeZone::getNextTransition(), and BasicTimeZone::getSimpleRulesNear().

    int32_t year, month, dom, dow, doy, mid;
    Grego::timeToFields(base, year, month, dom, dow, doy, mid);
    if (year < fStartYear) {
        return getFirstStart(prevRawOffset, prevDSTSavings, result);
    UDate tmp;
    if (getStartInYear(year, prevRawOffset, prevDSTSavings, tmp)) {
        if (tmp < base || (!inclusive && (tmp == base))) {
            // Return the next one
            return getStartInYear(year + 1, prevRawOffset, prevDSTSavings, result);
        } else {
            result = tmp;
            return TRUE;
    return FALSE;

Generated by  Doxygen 1.6.0   Back to index