Go to home page mail me! RSS Feed
FoxMetrics Web Analytics

Get week number from date

Monday, April 05, 2010 12:00 AM

Here is a simple way to get the week number given a certain date and time.

int week = System.Globalization.CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(
    dt, System.Globalization.CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Sunday);

DotNetKicks Image

Your Comments.

No comments posted yet.

Your Reply.

Comment Form.

Fields denoted with a "*" are required.

You may also like to leave your email or website.

 
Please add 2 and 7 and type the answer here:

Preview Your Comment.

 
Next entries »