I would like to use two datepicker in WPF and capture the length of days in between start date and end date, and want to incorporate the number of days in my program how do I do that?
Asked
Active
Viewed 192 times
0
-
You should break your problem down. You actually have two problems here: 1) How to get the `DateTime` value from the datepicker. 2) How to calculate the number of days between two dates. – ProgrammingLlama Jan 25 '21 at 08:36
-
Note in [this answer](https://stackoverflow.com/a/41447505/3181933) you don't need to convert your date to a string, though you should still perform the `HasValue` check. – ProgrammingLlama Jan 25 '21 at 08:38
-
You are right its a two part question, do you have a simple code example? – floflo1975 Jan 25 '21 at 09:41
-
Are the two linked questions not sufficient? – ProgrammingLlama Jan 25 '21 at 13:51
-
Thank you, I see the link now :) – floflo1975 Jan 25 '21 at 17:38