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
Gets or sets the unit of time represented by Value.
public TimeUnit? Unit { get; set; }
Property Value
See Also
Value
Gets or sets the value of the interval.
Methods
Equals(object)
Determines whether the specified object is equal to this instance.
GetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
- int:
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
ToString()
Returns a string that represents this instance.
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.