当月 今年 并在telerik rad日期选择器中开始日期(1为常数) 我正在努力获得日期1 =年,6个月,1 date2 =年,当月,1
我可以获得如下的当前日期
startdatepicker.SelectedDate = DateTime.Now;
//startdatepicker.SelectedDate = new DateTime(DateTime.Now.Year, DateTime.Now.AddMonths(-6), 1);//-->this not working
答案 0 :(得分:0)
这应该有效,除非我误解了你的问题......
startdatepicker.SelectedDate = new DateTime(DateTime.Now.Year,DateTime.Now.Month,1);
答案 1 :(得分:0)
我得到了:
DateTime end = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
enddate.SelectedDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
start.SelectedDate = (end.AddMonths(-6));