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 | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/CSharpNET/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
