jojacafe
12/30/2015 - 9:34 AM

Month by week and year

Month by week and year

Dim tDt As DateTime = New DateTime(year, 1, 1).AddDays(week * 7)

Dim tWeek As Integer = System.Globalization.CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(tDt, System.Globalization.CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday)

If week < tWeek Then
  tDt = tDt.AddDays(-7)
End If