Class SingleTransitionDateTimeZone
Time zone with a single transition between two offsets. This provides a simple way to test behaviour across a transition.
Since 1.0.x
Availability netstandard2.0
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Namespace: NodaTime.Testing.TimeZones
Assembly: NodaTime.Testing.dll
Syntax
public sealed class SingleTransitionDateTimeZone : DateTimeZone, IZoneIntervalMap
Constructors
SingleTransitionDateTimeZone(Instant, Offset, Offset)
Creates a zone with a single transition between two offsets.
Since 1.0.x
Availability netstandard2.0
Declaration
public SingleTransitionDateTimeZone(Instant transitionPoint, Offset offsetBefore, Offset offsetAfter)
Parameters
Type | Name | Description |
---|---|---|
Instant | transitionPoint | The transition point as an Instant. |
Offset | offsetBefore | The offset of local time from UTC before the transition. |
Offset | offsetAfter | The offset of local time from UTC before the transition. |
SingleTransitionDateTimeZone(Instant, Offset, Offset, String)
Creates a zone with a single transition between two offsets.
Since 1.1.x
Availability netstandard2.0
Declaration
public SingleTransitionDateTimeZone(Instant transitionPoint, Offset offsetBefore, Offset offsetAfter, string id)
Parameters
Type | Name | Description |
---|---|---|
Instant | transitionPoint | The transition point as an Instant. |
Offset | offsetBefore | The offset of local time from UTC before the transition. |
Offset | offsetAfter | The offset of local time from UTC before the transition. |
String | id | ID for the newly created time zone. |
SingleTransitionDateTimeZone(Instant, Int32, Int32)
Creates a zone with a single transition between two offsets.
Since 1.0.x
Availability netstandard2.0
Declaration
public SingleTransitionDateTimeZone(Instant transitionPoint, int offsetBeforeHours, int offsetAfterHours)
Parameters
Type | Name | Description |
---|---|---|
Instant | transitionPoint | The transition point as an Instant. |
Int32 | offsetBeforeHours | The offset of local time from UTC, in hours, before the transition. |
Int32 | offsetAfterHours | The offset of local time from UTC, in hours, before the transition. |
Properties
EarlyInterval
Gets the ZoneInterval for the period before the transition, starting at the beginning of time.
Since 1.0.x
Availability netstandard2.0
Declaration
public ZoneInterval EarlyInterval { get; }
Property Value
Type | Description |
---|---|
ZoneInterval | The zone interval for the period before the transition, starting at the beginning of time. |
LateInterval
Gets the ZoneInterval for the period after the transition, ending at the end of time.
Since 1.0.x
Availability netstandard2.0
Declaration
public ZoneInterval LateInterval { get; }
Property Value
Type | Description |
---|---|
ZoneInterval | The zone interval for the period after the transition, ending at the end of time. |
Transition
Gets the transition instant of the zone.
Since 1.1.x
Availability netstandard2.0
Declaration
public Instant Transition { get; }
Property Value
Type | Description |
---|---|
Instant | The transition instant of the zone. |
Methods
GetZoneInterval(Instant)
Gets the zone interval for the given instant; the range of time around the instant in which the same Offset
applies (with the same split between standard time and daylight saving time, and with the same offset).
Since 1.0.x
Availability netstandard2.0
Declaration
public override ZoneInterval GetZoneInterval(Instant instant)
Parameters
Type | Name | Description |
---|---|---|
Instant | instant | The Instant to query. |
Returns
Type | Description |
---|---|
ZoneInterval | The defined ZoneInterval. |
Overrides
Remarks
This will always return a valid zone interval, as time zones cover the whole of time.
This returns either the zone interval before or after the transition, based on the instant provided.