Archive for March, 2008
DateTime.Round extension method
I recently needed to group by minutes (or seconds, or hours, or days) in a LINQ expression, and I found that there isn’t a round function built into the C# DateTime object. The following will round to the nearest second, minute, hour, or day. I stopped there because different months have different numbers of days [...]
Read Full Post | Make a Comment ( 5 so far )