I was wondering if anyone could suggest a utility library that has useful functions for handling dates in ASP.NET easily taking away some of the leg work you normally have to do when handling dates?
Subsonic Sugar has some really nice functions:
http://subsonichelp.com/html/1413bafa-b5aa-99aa-0478-10875abe82ec.htm http://subsonicproject.googlecode.com/svn/trunk/SubSonic/Sugar/
Is there anything better out there?
I was wanting to work out the start(mon) and end(sun) dates of the last 5 weeks.
I was thinking something like this:
DateTime Now = DateTime.Now;
while(Now.DayOfWeek != DayOfWeek.Monday)
{
Now.AddDays(-1);
}
for(int i=0; i<5;i++)
{
AddToDatesList(Now, Now.AddDays(7));
Now.AddDays(-7);
}
but this seems crappy? Plus this is not exactly what i want because i need the time of that start date to be 00:00:00 and the time of the end date to be 23:59:59