Sdílet prostřednictvím


SimpleTimeZone.GetOffset(Int32, Int32, Int32, Int32, Int32, Int32) Method

Definition

Returns the difference in milliseconds between local time and UTC, taking into account both the raw offset and the effect of daylight saving, for the specified date and time.

[Android.Runtime.Register("getOffset", "(IIIIII)I", "GetGetOffset_IIIIIIHandler")]
public override int GetOffset (int era, int year, int month, int day, int dayOfWeek, int millis);
[<Android.Runtime.Register("getOffset", "(IIIIII)I", "GetGetOffset_IIIIIIHandler")>]
override this.GetOffset : int * int * int * int * int * int -> int

Parameters

era
Int32

The era of the given date.

year
Int32

The year in the given date.

month
Int32

The month in the given date. Month is 0-based. e.g., 0 for January.

day
Int32

The day-in-month of the given date.

dayOfWeek
Int32

The day-of-week of the given date.

millis
Int32

The milliseconds in day in <em>standard</em> local time.

Returns

The milliseconds to add to UTC to get local time.

Attributes

Remarks

Returns the difference in milliseconds between local time and UTC, taking into account both the raw offset and the effect of daylight saving, for the specified date and time. This method assumes that the start and end month are distinct. It also uses a default GregorianCalendar object as its underlying calendar, such as for determining leap years. Do not use the result of this method with a calendar other than a default GregorianCalendar.

<em>Note: In general, clients should use Calendar.get(ZONE_OFFSET) + Calendar.get(DST_OFFSET) instead of calling this method.</em>

Java documentation for java.util.SimpleTimeZone.getOffset(.*int, .*int, .*int, .*int, .*int, .*int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to