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 net45, netstandard1.3, netstandard2.0
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: NodaTime.Testing.TimeZones
Assembly: NodaTime.Testing.dll
Syntax
public sealed class SingleTransitionDateTimeZone : DateTimeZone, IZoneIntervalMapWithMinMax, IZoneIntervalMap
Constructors
SingleTransitionDateTimeZone(Instant, Offset, Offset)
Creates a zone with a single transition between two offsets.
Since 1.0.x
Availability net45, netstandard1.3, 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 net45, netstandard1.3, 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 net45, netstandard1.3, 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 net45, netstandard1.3, 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 net45, netstandard1.3, 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 net45, netstandard1.3, netstandard2.0
Declaration
public Instant Transition { get; }
Property Value
Type | Description |
---|---|
Instant | The transition instant of the zone. |
Methods
GetZoneInterval(Instant)
Since 1.0.x
Availability net45, netstandard1.3, netstandard2.0
Declaration
public override ZoneInterval GetZoneInterval(Instant instant)
Parameters
Type | Name | Description |
---|---|---|
Instant | instant |
Returns
Type | Description |
---|---|
ZoneInterval |
Overrides
Remarks
This returns either the zone interval before or after the transition, based on the instant provided.