soulpumpkin
Programmer
I've seen some similar question, but trying to get the week number from a date. I'm trying to get a date from a week number though, and I'm having a little trouble. The data coming in looks like this:
Here is some of the code I am using:
Results in strTempWeek from supplied dates above come out as:
This is happening because the first day of that year is a Thursday, so it's going Thursday to Thurday.
How do get it calculate from the first week, not from the first day?
Soul Pumpkin
Code:
12-04 (this would be the 12th week of 2004)
13-04 (this would be the 13th week of 2004)
14-04 (this would be the 14th week of 2004)
etc...
Here is some of the code I am using:
Code:
Dim CulInfo As New System.Globalization.CultureInfo(cntry, False)
Dim arrDate As Array
strTempWeek = ""
arrDate = strTempWeek.Split("-")
arrDate(1) = CulInfo.DateTimeFormat.Calendar.ToFourDigitYear(arrDate(1))
strTempWeek = CulInfo.DateTimeFormat.Calendar.AddWeeks("1/1/" & arrDate(1), arrDate(0))
Results in strTempWeek from supplied dates above come out as:
Code:
3/25/2004 (should be 3/14/2004)
4/1/2004 (should be 3/21/2004)
4/8/2004 (should be 3/28/2004)
This is happening because the first day of that year is a Thursday, so it's going Thursday to Thurday.
How do get it calculate from the first week, not from the first day?
Soul Pumpkin