1

I need to calculate the date of the first day in a calendar week given a year/week, e.g.

Week 53 in 2009 -> Mon, 28.12.2009
Week 1 in 2010 -> Mon, 04.01.2010

How would you wirte that code?

PS: In the Gregorian calendar the first week of a year is the first week with 4 days.

Thomas Jespersen
  • 11,493
  • 14
  • 47
  • 55
  • duplicate? [http://stackoverflow.com/questions/662379/calculate-date-from-week-number/662547#662547](http://stackoverflow.com/questions/662379/calculate-date-from-week-number/662547#662547) – andreas Dec 04 '09 at 07:10

1 Answers1

0

If you don't want to do all the calculation yourself, use the System.Globalization.Calendar class. I think you can use the GetDayOfYear() method to get what you need.

Check this MSDN library for the example.

tranmq
  • 15,168
  • 3
  • 31
  • 27