Language

ZoneRules.GetDaylightSavings(Instant) Method

Definition

Gets the amount of daylight savings in use for the specified instant in this zone.

[Android.Runtime.Register("getDaylightSavings", "(Ljava/time/Instant;)Ljava/time/Duration;", "", ApiSince=26)]
public Java.Time.Duration? GetDaylightSavings(Java.Time.Instant? instant);
[<Android.Runtime.Register("getDaylightSavings", "(Ljava/time/Instant;)Ljava/time/Duration;", "", ApiSince=26)>]
member this.GetDaylightSavings : Java.Time.Instant -> Java.Time.Duration

Parameters

instant
Instant

The instant to find the daylight savings for. null may be ignored if the offsets can be determined without it.

Returns

The actual offset minus the standard offset at the specified instant.

Attributes

Exceptions

Thrown if instant is null and the implementation requires it to determine the offsets.

May be thrown while applying recurring rules. For example, Android 8 through 13 throw for Max when they need recurring rules. Runtime updates can change this behavior.

Remarks

Gets the amount of daylight savings in use for the specified instant in this zone. This provides access to historic information on how the amount of daylight savings has changed over time. This is the difference between the standard offset and the actual offset. Typically the amount is zero during winter and one hour during summer. Time-zones are second-based, so the nanosecond part of the duration will be zero. This default implementation calculates the duration from the actual and standard offsets.

When there are no fully defined wall-offset transitions, Android 8 through 13 return zero even if the base wall offset differs from the base standard offset. Android 14 through 17 return the difference between the wall and standard offsets. Runtime updates can change this behavior.

Java reference for java.time.zone.ZoneRules.getDaylightSavings.

Applies to