Hi,
with this code I get the week number of the year:
Code:
Imports System.Globalization
Public Class Form1
Dim dateNow = DateTime.Now
Dim dfi = DateTimeFormatInfo.CurrentInfo
Dim calendar = dfi.Calendar
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
' using Thursday because I can.
Dim weekOfyear = calendar.GetWeekOfYear(dateNow, dfi.CalendarWeekRule, DayOfWeek.Thursday)
Label1.Text = weekOfyear
End Sub
End Class
Should I do the opposite, that is, from the weekOfyear derive the date (dd/mm/yyyy)…? thanks..