Extensions - DateTime 12/1/2009 All Extensions posts
These two method extensions are useful for finding the real start and real end of any given DateTime and are useful when writing SQL Queries with LINQ or otherwise.
public static DateTime AbsoluteStart(this DateTime dateTime)
{
return dateTime.Date;
}
public static DateTime AbsoluteEnd(this DateTime dateTime)
{
return AbsoluteStart(dateTime).AddDays(1).AddTicks(-1);
}