Finding week-number from selected dtae in calendar

  • Thread starter Thread starter ReidarT
  • Start date Start date
R

ReidarT

How do I find the weeknumber from a selected date from the calendar?
regards
reidarT
 
Hello,

here an example for culture "nl-Be"

kind regards,

Stefan

Public Function BepaalWeeknummer(ByVal x As Date) As String

Dim myCI As New CultureInfo("nl-BE")

Dim myCal As Calendar = myCI.Calendar

Dim myCWR As CalendarWeekRule = myCI.DateTimeFormat.CalendarWeekRule.FirstFourDayWeek

Dim myFirstDOW As DayOfWeek = myCI.DateTimeFormat.FirstDayOfWeek

If x.ToString <> "" Then

Return myCal.GetWeekOfYear(x, myCWR, myFirstDOW).ToString()

End If

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top