Noda Time
Show / Hide Table of Contents

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
Inheritance
Object
DateTimeZone
SingleTransitionDateTimeZone
Inherited Members
DateTimeZone.Utc
DateTimeZone.ForOffset(Offset)
DateTimeZone.Id
DateTimeZone.MinOffset
DateTimeZone.MaxOffset
DateTimeZone.GetUtcOffset(Instant)
DateTimeZone.MapLocal(LocalDateTime)
DateTimeZone.AtStartOfDay(LocalDate)
DateTimeZone.ResolveLocal(LocalDateTime, ZoneLocalMappingResolver)
DateTimeZone.AtStrictly(LocalDateTime)
DateTimeZone.AtLeniently(LocalDateTime)
DateTimeZone.ToString()
DateTimeZone.GetZoneIntervals(Instant, Instant)
DateTimeZone.GetZoneIntervals(Interval)
DateTimeZone.GetZoneIntervals(Interval, ZoneEqualityComparer.Options)
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, IZoneIntervalMapWithMinMax, 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
DateTimeZone.GetZoneInterval(Instant)
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.
In this article
Back to top Generated by DocFX