TimeZone.GetOffset Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetOffset(Int64) |
Returns the offset of this time zone from UTC at the specified date. |
GetOffset(Int32, Int32, Int32, Int32, Int32, Int32) |
Gets the time zone offset, for current date, modified in case of daylight savings. |
GetOffset(Int64)
Returns the offset of this time zone from UTC at the specified date.
[Android.Runtime.Register("getOffset", "(J)I", "GetGetOffset_JHandler")]
public virtual int GetOffset (long date);
[<Android.Runtime.Register("getOffset", "(J)I", "GetGetOffset_JHandler")>]
abstract member GetOffset : int64 -> int
override this.GetOffset : int64 -> int
Parameters
- date
- Int64
the date represented in milliseconds since January 1, 1970 00:00:00 GMT
Returns
the amount of time in milliseconds to add to UTC to get local time.
- Attributes
Remarks
Returns the offset of this time zone from UTC at the specified date. If Daylight Saving Time is in effect at the specified date, the offset value is adjusted with the amount of daylight saving.
This method returns a historically correct offset value if an underlying TimeZone implementation subclass supports historical Daylight Saving Time schedule and GMT offset changes.
Added in 1.4.
Java documentation for java.util.TimeZone.getOffset(long)
.
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
GetOffset(Int32, Int32, Int32, Int32, Int32, Int32)
Gets the time zone offset, for current date, modified in case of daylight savings.
[Android.Runtime.Register("getOffset", "(IIIIII)I", "GetGetOffset_IIIIIIHandler")]
public abstract int GetOffset (int era, int year, int month, int day, int dayOfWeek, int milliseconds);
[<Android.Runtime.Register("getOffset", "(IIIIII)I", "GetGetOffset_IIIIIIHandler")>]
abstract member 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.
- milliseconds
- Int32
the milliseconds in day in <em>standard</em> local time.
Returns
the offset in milliseconds to add to GMT to get local time.
- Attributes
Remarks
Gets the time zone offset, for current date, modified in case of daylight savings. This is the offset to add to UTC to get local time.
This method returns a historically correct offset if an underlying TimeZone
implementation subclass supports historical Daylight Saving Time schedule and GMT offset changes.
Java documentation for java.util.TimeZone.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.