DateTimeExtensions..::..IsBetween Method

Determines whether the specified start date is between. Checks if the date is between the two provided dates var today = DateTime.Now; var start = new DateTime(2012, 1, 1); var end = new DateTime(2013, 11, 25); Boolean isBetween = today.IsBetween(start, end);

Namespace:  Core
Assembly:  Core (in Core.dll)

Syntax


public static bool IsBetween(
	DateTime dt,
	DateTime startDate,
	DateTime endDate,
	bool compareTime
)

Parameters

dt
Type: DateTime
The dt.
startDate
Type: DateTime
The start date.
endDate
Type: DateTime
The end date.
compareTime
Type: Boolean
if set to true [compare time].

Return Value

true if the specified start date is between; otherwise, false.