Helper methods StartOfMonth and StartOfNextMonth

Posted by Michael Freidgeim on Geeks with Blogs See other posts from Geeks with Blogs or by Michael Freidgeim
Published on Fri, 11 Jun 2010 23:26:58 GMT Indexed on 2010/06/11 23:33 UTC
Read the original article Hit count: 244

Filed under:
 There are couple methods recently added to My DateTimeHelper class
    public static DateTime StartOfMonth(this DateTime dateValue)
        {
            return new DateTime(dateValue.Year,dateValue.Month,1,0,0,0);
        }
        public static DateTime StartOfNextMonth(this DateTime dateValue)
        {
            return StartOfMonth(dateValue).AddMonths(1);
        }


 

© Geeks with Blogs or respective owner