locked
Using DatePicker

    Question

  • I have a DatePicker control on my form. I would like to calculate the difference in DAYS between the date selected and the current date. I would like to display to the user how many days have passed since that date and now. How can I do this?

    Wednesday, May 07, 2014 3:59 AM

Answers

  • Hi, DAYS between the date selected and the current date:

    (DatePicker.Date - DateTimeOffset.Now).TotalDays

    • Marked as answer by burg1n Wednesday, May 07, 2014 4:55 AM
    Wednesday, May 07, 2014 4:11 AM

All replies

  • Hi, DAYS between the date selected and the current date:

    (DatePicker.Date - DateTimeOffset.Now).TotalDays

    • Marked as answer by burg1n Wednesday, May 07, 2014 4:55 AM
    Wednesday, May 07, 2014 4:11 AM
  • Wow, much more simple than what I thought needed to be done. Thanks!
    Wednesday, May 07, 2014 4:55 AM