Class ZoneInterval
Represents a range of time for which a particular Offset applies.
Since 1.4.x
Availability net35-Client, PCL
Inheritance
Object
ZoneInterval
Implements
IEquatable<ZoneInterval>
Inherited Members
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Namespace: NodaTime.TimeZones
Assembly: NodaTime.dll
Syntax
public sealed class ZoneInterval : IEquatable<ZoneInterval>
Constructors
ZoneInterval(String, Instant, Instant, Offset, Offset)
Initializes a new instance of the ZoneInterval class.
Since 1.4.x
Availability net35-Client, PCL
Declaration
public ZoneInterval(string name, Instant start, Instant end, Offset wallOffset, Offset savings)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of this offset period (e.g. PST or PDT). |
Instant | start | The first Instant that the wallOffset applies. |
Instant | end | The last Instant (exclusive) that the wallOffset applies. |
Offset | wallOffset | The WallOffset from UTC for this period including any daylight savings. |
Offset | savings | The WallOffset daylight savings contribution to the offset. |
Exceptions
Type | Condition |
---|---|
ArgumentException | If . |
ArgumentNullException | name is null. |
Properties
Duration
Gets the duration of this period.
Since 1.4.x
Availability net35-Client, PCL
Declaration
public Duration Duration { get; }
Property Value
Type | Description |
---|---|
Duration | The Duration of this period. |
Remarks
This is effectively
End - Start
.
End
Gets the last Instant (exclusive) that the Offset applies.
Since 1.4.x
Availability net35-Client, PCL
Declaration
public Instant End { get; }
Property Value
Type | Description |
---|---|
Instant | The last Instant (exclusive) that the Offset applies. |
IsoLocalEnd
Returns the local start time of the interval, as LocalDateTime
in the ISO calendar. This does not include any daylight saving
Since 1.4.x
Availability net35-Client, PCL
Declaration
public LocalDateTime IsoLocalEnd { get; }
Property Value
Type | Description |
---|---|
LocalDateTime |
IsoLocalStart
Returns the local start time of the interval, as LocalDateTime
in the ISO calendar.
Since 1.4.x
Availability net35-Client, PCL
Declaration
public LocalDateTime IsoLocalStart { get; }
Property Value
Type | Description |
---|---|
LocalDateTime |
Name
Gets the name of this offset period (e.g. PST or PDT).
Since 1.4.x
Availability net35-Client, PCL
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
String | The name of this offset period (e.g. PST or PDT). |
Savings
Gets the daylight savings value for this period.
Since 1.4.x
Availability net35-Client, PCL
Declaration
public Offset Savings { get; }
Property Value
Type | Description |
---|---|
Offset | The savings value. |
StandardOffset
Gets the standard offset for this period. This is the offset without any daylight savings
contributions.
Since 1.4.x
Availability net35-Client, PCL
Declaration
public Offset StandardOffset { get; }
Property Value
Type | Description |
---|---|
Offset | The base Offset. |
Remarks
This is effectively
Offset - Savings
.
Start
Gets the first Instant that the Offset applies.
Since 1.4.x
Availability net35-Client, PCL
Declaration
public Instant Start { get; }
Property Value
Type | Description |
---|---|
Instant | The first Instant that the Offset applies. |
WallOffset
Gets the offset from UTC for this period. This includes any daylight savings value.
Since 1.4.x
Availability net35-Client, PCL
Declaration
public Offset WallOffset { get; }
Property Value
Type | Description |
---|---|
Offset | The offset from UTC for this period. |
Methods
Contains(Instant)
Determines whether this period contains the given Instant in its range.
Since 1.4.x
Availability net35-Client, PCL
Declaration
public bool Contains(Instant instant)
Parameters
Type | Name | Description |
---|---|---|
Instant | instant | The instant to test. |
Returns
Type | Description |
---|---|
Boolean |
true if this period contains the given Instant in its range; otherwise, false .
|
Remarks
Usually this is half-open, i.e. the end is exclusive, but an interval with an end point of "the end of time"
is deemed to be inclusive at the end.
Equals(ZoneInterval)
Indicates whether the current object is equal to another object of the same type.
Since 1.4.x
Availability net35-Client, PCL
Declaration
public bool Equals(ZoneInterval other)
Parameters
Type | Name | Description |
---|---|---|
ZoneInterval | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
Boolean |
true if the current object is equal to the other parameter; otherwise, false.
|
Equals(Object)
Determines whether the specified System.Object is equal to the current System.Object.
Since 1.4.x
Availability net35-Client, PCL
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The System.Object to compare with the current System.Object. |
Returns
Type | Description |
---|---|
Boolean |
true if the specified System.Object is equal to the current System.Object; otherwise, false .
|
Overrides
System.Object.Equals(System.Object)
GetHashCode()
Serves as a hash function for a particular type.
Since 1.4.x
Availability net35-Client, PCL
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A hash code for the current System.Object. |
Overrides
System.Object.GetHashCode()
ToString()
Returns a System.String that represents this instance.
Since 1.4.x
Availability net35-Client, PCL
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A System.String that represents this instance. |
Overrides
System.Object.ToString()
Implements
System.IEquatable<T>