Subtracting two dates

前端 未结 3 1098
没有蜡笔的小新
没有蜡笔的小新 2020-12-29 03:05

I have two calendars and each return a DateTime from calendar.SelectedDate.

How do I go about subtracting the two selected dates from each other, giving me the amoun

3条回答
  •  轮回少年
    2020-12-29 03:42

    You can use someDateTime.Subtract(otherDateTime), this returns a TimeSpan which has a TotalDays property.

提交回复
热议问题