HELP ! I use Sheduler . I want count all sunday in beween tow days
Asked by Help me!
13 years ago.
EX day format : MM/DD/YYYY
start day : "4 - 1 - 2013 "
End day : " 5 - 2 - 2013 "
I WANT COUNT ALL SUNDAY IN TO 4-1-2013 FROM 5 /2 / 2013
Answer posted by Dan Letecky [DayPilot]
13 years ago.
DateTime start = Convert.ToDateTime("2013-04-01");
DateTime end = Convert.ToDateTime("2013-05-02");
int count = 0;
for(DateTime d = start.Date; d < end.Date; d = d.AddDays(1)) {
if (d.DayOfWeek == DaysOfWeek.Sunday) {
count += 1;
}
}
Comment posted by Anonymous
13 years ago.
This question is more than 1 month old and has been closed. Please create a new question if you have anything to add.