24 August, 2010
Roel van Lisdonk
0 Comments
1 category
If you want to get the week number of a date in C#, use the following function:
private int GetWeekNumber(DateTime date) { return CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(date, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday); }
Tags: C#
Category: Uncategorized
One Reply to “How to determine the week number of a date in C#”
Leave a Reply
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Related Posts
2020-06-30 Learned Today
30 June, 2020
Roel van Lisdonk
0 Comments
1 category
Fixing: Container cannot be copied onto existing leaf item…
Microsoft SQL Server DBCC reseed does not take into account the existing ID’s
5 December, 2011
Roel van Lisdonk
0 Comments
1 category
A colleague of mine (Mattijs ter Heijde) created a simple…
One of the most important things to remember: In C# and JavaScript, object references are passed to functions by value not by reference
4 February, 2015
Roel van Lisdonk
0 Comments
1 category
By default C# and JavaScript pass object references by value…
Zat daar geen bugje in?
http://blogs.msdn.com/b/shawnste/archive/2006/01/24/iso-8601-week-of-year-format-in-microsoft-net.aspx
Ik heb het niet uitgeprobeerd maar volgens mij is dat er niet uit sinds 4.0.