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

Gets or sets the unit of time represented by Value.

public TimeUnit? Unit { get; set; }

Property Value

TimeUnit?:

The unit of time represented by Value.

See Also

Value

Gets or sets the value of the interval.

public long? Value { get; set; }

Property Value

long?:

The value of the interval.

See Also

Methods

Equals(object)

Determines whether the specified object is equal to this instance.

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 this instance; otherwise, false.

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.

public override string ToString()

Returns

string:

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.

Inherited Members