Hi,
      This is my first mail in this group. I am the member of this group since last week. From last few days some of my group mates are working to find out the number of week days in a month. This method is also going to work.


using System.Globalization;
using System.Threading;

private int GetWeekDay(int month, int year)
{
      Calendar calendar = Thread.CurrentThread.CurrentCulture.DateTimeFormat.Calendar;
      DateTime date = new DateTime(year, month, 1);
      int days = -1;
      days = Convert.ToInt32 (calendar.GetDaysInMonth(year,month));
      while (date.Month == month)
      {
            if (calendar.GetDayOfWeek(date) == DayOfWeek.Saturday || calendar.GetDayOfWeek(date) == DayOfWeek.Sunday)
            {
                  days--;
            }
            date = date.AddDays(1);
      }
      return days;
}





Mr. Jayabrata Saha
Globsyn Technologies Limited
Mobile: +91.9830577409
Email: [EMAIL PROTECTED]


Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=315388.5526708.6599542.3001176/D=groups/S=:HM/A=2372354/rand=324869357


Yahoo! Groups Links

Reply via email to