I'm trying to build a project and trying to compare between two dates from the date time picker.
Let's say it's departure and arrival time. The user chooses the date 5/11/2016 on departure and 6/11/2016 on arrival.
The code is below:
DateTime departure = dtpDeparture.Value.Date;
DateTime arrival = dtpArrival.Value.Date;
(departure - arrival).TotalDays has always worked for me. Make sure your date format is correct too, you might be checking from May 11th to June 11th.