ZoneOffset Class
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.
A time-zone offset from Greenwich/UTC, such as +02:00.
[Android.Runtime.Register("java/time/ZoneOffset", ApiSince=26, DoNotGenerateAcw=true)]
public sealed class ZoneOffset : Java.Time.ZoneId, IDisposable, Java.Interop.IJavaPeerable, Java.Lang.IComparable, Java.Time.Temporal.ITemporalAccessor, Java.Time.Temporal.ITemporalAdjuster
[<Android.Runtime.Register("java/time/ZoneOffset", ApiSince=26, DoNotGenerateAcw=true)>]
type ZoneOffset = class
inherit ZoneId
interface ISerializable
interface IJavaObject
interface IDisposable
interface IJavaPeerable
interface IComparable
interface ITemporalAccessor
interface ITemporalAdjuster
- Inheritance
- Attributes
- Implements
Remarks
A time-zone offset from Greenwich/UTC, such as +02:00.
A time-zone offset is the amount of time that a time-zone differs from Greenwich/UTC. This is usually a fixed number of hours and minutes.
Different parts of the world have different time-zone offsets. The rules for how offsets vary by place and time of year are captured in the ZoneId class.
For example, Paris is one hour ahead of Greenwich/UTC in winter and two hours ahead in summer. The ZoneId instance for Paris will reference two ZoneOffset instances - a +01:00 instance for winter, and a +02:00 instance for summer.
In 2008, time-zone offsets around the world extended from -12:00 to +14:00. To prevent any problems with that range being extended, yet still provide validation, the range of offsets is restricted to -18:00 to 18:00 inclusive.
This class is designed for use with the ISO calendar system. The fields of hours, minutes and seconds make assumptions that are valid for the standard ISO definitions of those fields. This class may be used with other calendar systems providing the definition of the time fields matches those of the ISO calendar system.
Instances of ZoneOffset must be compared using #equals. Implementations may choose to cache certain common offsets, however applications must not rely on such caching.
Added in 1.8.
Java documentation for java.time.ZoneOffset.
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.
Properties
| Name | Description |
|---|---|
| Class |
Returns the runtime class of this |
| Handle |
The handle to the underlying Android instance. (Inherited from Object) |
| Id |
Gets the normalized zone offset ID. |
| JniIdentityHashCode |
Gets the identity hash code assigned to this Java peer by the interop runtime. (Inherited from Object) |
| JniPeerMembers | |
| Max |
Constant for the maximum supported offset. |
| Min |
Constant for the minimum supported offset. |
| PeerReference |
Gets the JNI object reference for this Java peer. (Inherited from Object) |
| Rules |
Gets the associated time-zone rules. |
| ThresholdClass | (Inherited from ZoneId) |
| ThresholdType | (Inherited from ZoneId) |
| TotalSeconds |
Gets the total zone offset in seconds. |
| Utc |
The time-zone offset for UTC, with an ID of 'Z'. |
Methods
| Name | Description |
|---|---|
| AdjustInto(ITemporal) |
Adjusts the specified temporal object to have the same offset as this object. |
| Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
| CompareTo(ZoneOffset) |
Compares this offset to another offset in descending order. |
| Dispose() |
Releases the resources held by this Java peer. (Inherited from Object) |
| Dispose(Boolean) |
Releases the resources held by this Java peer. (Inherited from Object) |
| Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
| From(ITemporalAccessor) |
Obtains an instance of |
| Get(ITemporalField) |
Gets the value of the specified field from this offset as an |
| GetDisplayName(TextStyle, Locale) | (Inherited from ZoneId) |
| GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
| GetLong(ITemporalField) |
Gets the value of the specified field from this offset as a |
| IsSupported(ITemporalField) |
Checks if the specified field is supported. |
| JavaFinalize() |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. (Inherited from Object) |
| Normalized() | (Inherited from ZoneId) |
| Notify() |
Wakes up a single thread that is waiting on this object's monitor. (Inherited from Object) |
| NotifyAll() |
Wakes up all threads that are waiting on this object's monitor. (Inherited from Object) |
| Of(String) |
Obtains an instance of |
| OfHours(Int32) |
Obtains an instance of |
| OfHoursMinutes(Int32, Int32) |
Obtains an instance of |
| OfHoursMinutesSeconds(Int32, Int32, Int32) |
Obtains an instance of |
| OfTotalSeconds(Int32) |
Obtains an instance of |
| Query(ITemporalQuery) |
Queries this offset using the specified query. |
| Range(ITemporalField) |
Gets the range of valid values for the specified field. |
| SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
| ToArray<T>() |
Creates a managed array from this Java array wrapper. (Inherited from Object) |
| ToString() |
Returns a string representation of the object. (Inherited from Object) |
| UnregisterFromRuntime() |
Unregisters this Java peer from the interop runtime. (Inherited from Object) |
| Wait() |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>. (Inherited from Object) |
| Wait(Int64, Int32) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
| Wait(Int64) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Explicit Interface Implementations
| Name | Description |
|---|---|
| IComparable.CompareTo(Object) | |
| IJavaPeerable.Disposed() |
Notifies the interop runtime that this managed peer has been disposed. (Inherited from Object) |
| IJavaPeerable.DisposeUnlessReferenced() |
Releases this Java peer unless it is retained by another managed reference. (Inherited from Object) |
| IJavaPeerable.Finalized() |
Notifies the interop runtime that this managed peer has been finalized. (Inherited from Object) |
| IJavaPeerable.JniManagedPeerState |
Gets the state that describes the relationship between this managed peer and its JNI reference. (Inherited from Object) |
| IJavaPeerable.SetJniIdentityHashCode(Int32) |
Sets the interop identity hash code for this Java peer. (Inherited from Object) |
| IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) |
Sets the managed and JNI peer state for this Java peer. (Inherited from Object) |
| IJavaPeerable.SetPeerReference(JniObjectReference) |
Sets the JNI object reference used by this managed peer. (Inherited from Object) |
Extension Methods
| Name | Description |
|---|---|
| GetJniTypeName(IJavaPeerable) |
Gets the JNI name of the type of the instance |
| JavaAs<TResult>(IJavaPeerable) |
Try to coerce |
| JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
| JavaCast<TResult>(IJavaObject) | |
| TryJavaCast<TResult>(IJavaPeerable, TResult) |
Try to coerce |