Hi Jim,
To get the first and last day of the week, you can use the following set of code:
int DaysToStartOfWeek = (int) DateTime.Today.DayOfWeek;
int DaysToEndOfWeek = (int)DayOfWeek.Saturday - (int)DateTime.Today.DayOfWeek;
DateTime StartWeek = DateTime.Today.Subtract(new TimeSpan(DaysToStartOfWeek,0,0,0));
DateTime EndWeek = DateTime.Today.Add(new TimeSpan(DaysToEndOfWeek,0,0,0));
>All,
>
> I am creating a webpage that lets the user select a daterange(today, this week, this month, etc). I got most of it to work, but don't know how to figure the this week portion of my task. Can someone please help?
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi