Skip to main content

TimeInterval Members

A time interval object.

Constructors

Name Description
TimeInterval() Initializes a new instance of the TimeInterval class with default settings.
TimeInterval(DateTime, DateTime) Initializes a new instance of the TimeInterval class with the specified start date and end date.
TimeInterval(DateTime, TimeSpan) Initializes a new instance of the TimeInterval class with the specified start date and duration.

Properties

Name Description
AllDay Gets or sets a value indicating if the time interval is All-Day.
Day static Gets the time interval of a day.
Duration Gets or sets the duration of the time interval.
Empty static Returns an empty time interval.
End Gets or sets the end date and time of the time interval.
LongerThanADay Gets a value that indicates whether the time interval’s duration is equal to or greater than one day.
SameDay Gets a value that indicates whether the time interval’s start and end times are on the same day.
Start Gets or sets the start date and time of the time interval.

Methods

Name Description
Clone() Creates a copy of the current TimeInterval object.
Clone(Boolean) Creates a copy of the current TimeInterval object.
Contains(TimeInterval) Determines whether the current time interval contains the specified time interval.
Contains(DateTime) Determines whether the time interval contains the specified date.
Equals(Object, Object) static Determines whether the specified object instances are considered equal. Inherited from Object.
Equals(Object) Determines whether the specified object is equal to the current TimeInterval 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(TimeInterval, TimeInterval) static Returns a time interval which is the intersection of the two specified time intervals.
Intersect(TimeInterval) Returns a time interval which is the intersection of the current time interval with the specified time interval.
IntersectsWith(TimeInterval) Checks if the current time interval intersects with the specified time interval.
IntersectsWithExcludingBounds(TimeInterval) Checks if the current time interval intersects with the specified time interval. The boundaries of the time intervals are excluded from the check.
IntersectsWithExcludingBoundsEx(TimeInterval) Checks if the current time interval intersects with the specified time interval. The boundaries of the time intervals are excluded from the check.
MemberwiseClone() protected Creates a shallow copy of the current Object. Inherited from Object.
Merge(TimeInterval) Returns a time interval which begins at the lowest start value and ends at the greatest end value of both specified intervals.
ReferenceEquals(Object, Object) static Determines whether the specified Object instances are the same instance. Inherited from Object.
Subtract(TimeInterval) Returns a time interval which is the subtraction of the specified time interval from the current time interval.
ToString() Returns the textual representation of the time interval.
ToString(IFormatProvider) Provides a string representation of the time interval, culture specific.
Union(TimeInterval, TimeInterval) static Returns a time interval which is composed of the two specified time intervals.
See Also