Click here to Skip to main content
12,349,148 members (66,420 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

5.1K views
1 bookmarked
Posted

Get week from Specific date

, 22 Apr 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
DateTime date = DateTime.Now;System.Globalization.CultureInfo cult_info = System.Globalization.CultureInfo.CreateSpecificCulture("no");System.Globalization.Calendar cal = cult_info.Calendar;int weekNo = cal.GetWeekOfYear(date, cult_info.DateTimeFormat.CalendarWeekRule,...
DateTime date = DateTime.Now;

System.Globalization.CultureInfo cult_info = System.Globalization.CultureInfo.CreateSpecificCulture("no");

System.Globalization.Calendar cal = cult_info.Calendar;

int weekNo = cal.GetWeekOfYear(date, cult_info.DateTimeFormat.CalendarWeekRule, cult_info.DateTimeFormat.FirstDayOfWeek);

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Peace ON
Software Developer (Senior)
India India
Short Stories Stories We Live...

You may also be interested in...

Comments and Discussions

 
GeneralReason for my vote of 4 Good tip Pin
subodhkant2-Feb-11 2:50
membersubodhkant2-Feb-11 2:50 
GeneralReason for my vote of 2 I live in sweden where week numbers ... Pin
Söderlund7-Jul-10 8:56
memberSöderlund7-Jul-10 8:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160621.1 | Last Updated 23 Apr 2010
Article Copyright 2010 by Peace ON
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid