DateTimeInterval Class
Represents an interval of time.
public class DateTimeInterval
- Inheritance:
- object object
Constructors
DateTimeInterval()
Initializes an instance of the class.
public DateTimeInterval()
Properties
Unit
The unit of time represented by Value.
Value
The value of the interval.
Methods
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
| Parameter | Type | Description |
|---|---|---|
| obj | object | The object to compare with the current object. |
Returns
- bool:
trueif the specified object is equal to the current object; otherwise,false.
GetHashCode()
Serves as the default hash function.
ToString()
Returns the string representation of this object.
ToTimeSpan(DateTime)
Converts the current DateTimeInterval to a TimeSpan.
public TimeSpan ToTimeSpan(DateTime dateTime)
| Parameter | Type | Description |
|---|---|---|
| dateTime | DateTime |
Returns
- TimeSpan:
A TimeSpan from the current DateTimeInterval.
Inherited Members
- object.GetType()
- object.MemberwiseClone()
- object.Equals(object, object)
- object.ReferenceEquals(object, object)