Jet Seighart Jet Seighart - 1 year ago 81
C# Question

Comparing Dates using C#'s DateTimePicker

Let's say I have a constant date of "March 1, 2016" (MMMM dd, yyyy) format. Is there any simple way to determine that my selected date in a DateTimePicker is greater than, less than or equal to the constant date?

Answer Source

Simple enough ?

var fixedDate = new DateTime(2016, 3, 1);
if (myDateTimePicker.Value >= fixedDate) {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download