Logo Search packages:      
Sourcecode: icu version File versions  Download package

int32_t RuleBasedTimeZone::getOffset ( uint8_t  era,
int32_t  year,
int32_t  month,
int32_t  day,
uint8_t  dayOfWeek,
int32_t  millis,
UErrorCode status 
) const [virtual]

Returns the TimeZone's adjusted GMT offset (i.e., the number of milliseconds to add to GMT to get local time in this time zone, taking daylight savings time into account) as of a particular reference date. The reference date is used to determine whether daylight savings time is in effect and needs to be figured into the offset that is returned (in other words, what is the adjusted GMT offset in this time zone at this particular date and time?). For the time zones produced by createTimeZone(), the reference data is specified according to the Gregorian calendar, and the date and time fields are local standard time.

Note: Don't call this method. Instead, call the getOffset(UDate...) overload, which returns both the raw and the DST offset for a given time. This method is retained only for backward compatibility.

Parameters:
era The reference date's era
year The reference date's year
month The reference date's month (0-based; 0 is January)
day The reference date's day-in-month (1-based)
dayOfWeek The reference date's day-of-week (1-based; 1 is Sunday)
millis The reference date's milliseconds in day, local standard time
status Output param to filled in with a success or an error.
Returns:
The offset in milliseconds to add to GMT to get local time. ICU 3.8

Implements TimeZone.

Definition at line 345 of file rbtz.cpp.

References Grego::monthLength(), U_FAILURE, U_ILLEGAL_ARGUMENT_ERROR, and UCAL_DECEMBER.

Referenced by getRawOffset(), inDaylightTime(), and useDaylightTime().

                                                                                          {
    if (U_FAILURE(status)) {
        return 0;
    }
    if (month < UCAL_JANUARY || month > UCAL_DECEMBER) {
        status = U_ILLEGAL_ARGUMENT_ERROR;
        return 0;
    } else {
        return getOffset(era, year, month, day, dayOfWeek, millis,
                         Grego::monthLength(year, month), status);
    }
}


Generated by  Doxygen 1.6.0   Back to index