Get Week of the Year

        /// <summary>
        /// Gets the week number of Year.
        /// </summary>
        /// <param name="dtPassed">The dt passed.</param>
        /// <returns></returns>
        private int GetWeekNumber(DateTime dtPassed)
        {
            CultureInfo ciCurr = CultureInfo.CurrentCulture;
            int weekNum = ciCurr.Calendar.GetWeekOfYear(dtPassed, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
            return weekNum;
        }
Published
Categorized as c# Tagged

Leave a comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.