Logo Search packages:      
Sourcecode: icu version File versions

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

Gets the most recent time when this rule takes effect before the specified time.

Parameters:
base The most recent time before 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 most recent time when this rule takes effect before the specified base time.
Returns:
true if the start time is available. When false is returned, output parameter "result" is unchanged. ICU 3.8

Implements TimeZoneRule.

Definition at line 375 of file tzrule.cpp.

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

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

                                                          {
    int32_t year, month, dom, dow, doy, mid;
    Grego::timeToFields(base, year, month, dom, dow, doy, mid);
    if (year > fEndYear) {
        return getFinalStart(prevRawOffset, prevDSTSavings, result);
    }
    UDate tmp;
    if (getStartInYear(year, prevRawOffset, prevDSTSavings, tmp)) {
        if (tmp > base || (!inclusive && (tmp == base))) {
            // Return the previous one
            return getStartInYear(year - 1, prevRawOffset, prevDSTSavings, result);
        } else {
            result = tmp;
            return TRUE;
        }
    }
    return FALSE;
}


Generated by  Doxygen 1.6.0   Back to index