ancy chacko

ancy chacko

  • NA
  • 71
  • 18.5k

Displaying number of days in label

Feb 3 2015 8:39 AM
i have two calender and two dropdownlist. i want to check number of days.needs of dropdownlist is checking halfday or fullday.
halfday is 0.5 and full day is 1
 i want to use the conditions....like if ....
where?

coding:

DateTime FromYear = Convert.ToDateTime(calfrom.SelectedDate);
            DateTime ToYear = Convert.ToDateTime(calto.SelectedDate);
            TimeSpan objTimeSpan = ToYear - FromYear;


            double Days = Convert.ToDouble(objTimeSpan.TotalDays );
           
            Label1.Text = Convert.ToString(Days);

Answers (3)