Quantcast
Channel: Developer's Alley - ASP .Net
Viewing all articles
Browse latest Browse all 12

How To Get The Week Of The Year By Using A Custom First Day Of The Week Value

$
0
0

TODO:

Have  you ever wanted to get the week of the year by using a a custom first day of the week?

 

SOLUTION:

var weekOfYear = CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(
                DateTime.Now,
                CalendarWeekRule.FirstDay,
                DayOfWeek.Monday);


NOTES:

This sample will get the week of the year by using the FirstDay of the week set to Monday, rather than the default of Sunday.


Viewing all articles
Browse latest Browse all 12

Latest Images

Trending Articles





Latest Images