Skip to main content

DateTimeRange Members

Time interval which provides extended operations such as Union and Intersect.

Constructors

Name Description
DateTimeRange(DateTimeRange) Initializes a new instance of the DateTimeRange class with specified settings.
DateTimeRange(DateTime, DateTime) Initializes a new instance of the DateTimeRange class with the specified settings.
DateTimeRange(DateTime, TimeSpan)

Properties

Name Description
Duration
Empty static Returns an empty datetime range.
End Gets the end date and time of the datetime range.
IsEmpty Determines whether the current datetime range is empty.
IsValid Gets whether the current datetime range is valid.
Start Gets the start date and time of the datetime range.
Today static

Methods

Name Description
Contains(DateTimeRange)
Contains(DateTime, Boolean)
Equals(DateTimeRange)
Equals(Object, Object) static Determines whether the specified object instances are considered equal. Inherited from Object.
Equals(Object) Defines whether the given object is equal to the current DateTimeRange instance.
GetHashCode() Gets the hash code (a number) that corresponds to the value of the current TimeInterval object.
GetType() Gets the Type of the current instance. Inherited from Object.
Intersect(DateTimeRange, DateTimeRange, Boolean) static
Intersect(DateTimeRange, Boolean)
IntersectsWith(DateTimeRange, DateTimeRange, Boolean) static
IntersectsWith(DateTimeRange, Boolean)
ReferenceEquals(Object, Object) static Determines whether the specified Object instances are the same instance. Inherited from Object.
ToString() Returns the textual representation of the datetime range.
ToString(IFormatProvider) Provides a culture-specific string representation of the time range.
ToString(String, IFormatProvider)
TryParse(String, CultureInfo, out DateTimeRange) static
Union(DateTimeRange, DateTimeRange) static Returns a datetime range which is composed of the two given time ranges.
Union(DateTimeRange) Returns a datetime range which is composed of the current time range and the given datetime range.
See Also