In This Article

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.

public TimeUnit? Unit { get; set; }

Property Value

TimeUnit?

See Also

Value

The value of the interval.

public long? Value { get; set; }

Property Value

long?

See Also

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:

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int:

A hash code for the current object.

ToString()

Returns the string representation of this object.

public override string ToString()

Returns

string:

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

Extension Methods