Calculate month different using radMonthYearPicker

最后都变了- 提交于 2019-12-11 04:34:06

问题


I have 2 radMonthYearPicker(1 is for start Date another 1 is for end Date) I want to calculate the month different between this 2 date.

for my start Date, I set my month as dec and year 2012. for my end Date, I set my month as dec and year 2013

Base on this 2 RadMonthYearPicker, the month apart should be 12 month

The only code I can find out is RadMonthYearPicker.selectedDate

P.S. I was not allow to upload image file due to lack of repulation point


回答1:


int monthsApart = 12 * (startDate.Year - endDate.Year) + 
   startDate.Month - endDate.Month;

int result = Math.Abs(monthsApart);


来源:https://stackoverflow.com/questions/13767864/calculate-month-different-using-radmonthyearpicker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!