Finding week-number from selected dtae in calendar

  • Thread starter Thread starter ReidarT
  • Start date Start date
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

Date calendar in datagrid 1
Outlook Outlook 2
Excel Worksheet_BeforeDelete code not working as expected. 1
Weeknumbers 7
Weeknumbers 4
how to add weeknumbers in outlook calendar 1
Purpose 6
Find All users Desktop 1

Back
Top