• Sun, Feb 2012
  • RSS
  • Newsletter
  • Become a Fan!
  • Follow On Twitter
    • Subcribe to Our RSS Feed

    Get last date and first date of the month, using C#

    Posted In Asp.net - By admin On Wednesday, August 26th, 2009 With 0 Comments

    In this code we can get current month last date and first date , using C#.Net

     

    DateTime firstDay= new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);

     int DaysinMonth = DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month)-1;

    DateTime lastDay = firstDay.AddDays(DaysinMonth);

    About -

    Leave a comment

    XHTML: You can use these tags: