Dot Net Learning Zone Blog

A blog about to learn Dot Net

Archive for the ‘Uncategorized’ Category

How to count week in month

Posted by Rajesh on February 5, 2009

  public int GetWeekInMonth(int year, int month)

        {

            CultureInfo cinfo = CultureInfo.CurrentCulture;

            Calendar MyCal = CultureInfo.InvariantCulture.Calendar;

            int CountWeek = 0;

            for (int icount = 1; icount < cinfo.Calendar.GetDaysInMonth(year, month); icount++)

            {

                string str = Convert.ToString(MyCal.GetDayOfWeek(new DateTime(year, month, icount)));

                if (str.Equals(“Monday”, StringComparison.OrdinalIgnoreCase))

                {

                    CountWeek = CountWeek + 1;

                }

 

            }

            return CountWeek;

        }

 

 

Posted in Uncategorized | Leave a Comment »

Hello world!

Posted by Rajesh on August 3, 2007

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Posted in Uncategorized | 1 Comment »