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
Namespace: NodaTime.Testing.TimeZones
Assembly: NodaTime.Testing.dll
Syntax
public sealed class SingleTransitionDateTimeZone : DateTimeZone
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, int, int)
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. |
int | offsetBeforeHours | The offset of local time from UTC, in hours, before the transition. |
int | 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.