Skip to main content

DateTimeRange Members

The time range that provides access to extended operations, such as Union and IntersectWith.

Constructors

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

Properties

Name Description
Duration Gets the duration of the current time range.
Empty static Gets an empty time range.
End Gets the end value of the time range.
IsEmpty Gets whether the current time range is empty.
IsValid Gets whether the current time range is valid.
Start Gets the start value of the time range.
Today static Gets the today time range.

Methods

Name Description
Contains(DateTimeRange) Checks whether the current time range contains the specified time range.
Contains(DateTime) Checks whether the current time range contains the specified time.
Equals(DateTimeRange) Checks whether the current time range is equal to the specified time range.
Equals(Object, Object) static Determines whether the specified object instances are considered equal. Inherited from System.Object.
Equals(Object) Checks whether the specified object is equal to the current time range.
GetHashCode() Gets the hash code that corresponds to the current time range.
GetType() Gets the Type of the current instance. Inherited from System.Object.
Intersect(DateTimeRange, DateTimeRange) static Returns the time range that corresponds to the intersection of specified time ranges.
Intersect(DateTimeRange) Returns the time range that corresponds to the intersection of current and specified time ranges.
IntersectsWith(DateTimeRange, DateTimeRange, Boolean) static Checks whether specified time ranges intersect.
IntersectsWith(DateTimeRange, Boolean) Checks whether the specified time range intersects with the current range.
ReferenceEquals(Object, Object) static Determines whether the specified Object instances are the same instance. Inherited from System.Object.
ToString() Returns the time range’s display text.
ToString(IFormatProvider) Returns a culture-specific display text string of the time range.
ToString(String, IFormatProvider) Returns the culture-specific display text string of the time range in the specified format.
TryParse(String, CultureInfo, out DateTimeRange) static Tries to parse the specified string and convert it into the date-time range.
Union(DateTimeRange, DateTimeRange) static Calculates the union of specified time ranges.
Union(DateTimeRange) Calculates the union of current and specified time ranges.

Operators

Name Description
Equality(DateTimeRange, DateTimeRange) static Determines whether specified time ranges have the same values.
Inequality(DateTimeRange, DateTimeRange) static Determines whether specified time ranges have different values.
See Also