Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7670721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:53:14+00:00 2026-05-31T15:53:14+00:00

I’m looking for a definitive, standard (i.e. certified as being correct or tested reasonably

  • 0

I’m looking for a definitive, standard (i.e. certified as being correct or tested reasonably thoroughly) for calculating the ISO week from a date, in Visual Basic (i.e. to run in a Visual Studio Express 2010 Visual Basic project)

(Unsuccessful) Research so far:

  • I found some routines that were Visual Basic for Applications oriented; reliant on Excel environment, some things not present in Visual Studio Express 2010 Visual Basic:

    • http://www.xtremevbtalk.com/showthread.php?t=180642
    • http://www.ozgrid.com/forum/showthread.php?t=41999
    • http://www.ozgrid.com/forum/showthread.php?t=50982
    • http://www.vbaexpress.com/kb/getarticle.php?kb_id=744

  • DatePart Visual Basic library function may be useful: http://msdn.microsoft.com/en-us/library/20ee97hz(v=vs.80).aspx – BUT apparently there is a bug:
    “BUG: Format or DatePart Functions Can Return Wrong Week Number for Last Monday in Year”:
    http://support.microsoft.com/kb/200299 (has this been solved? It’s rather old, 2004 so perhaps?)

  • Other routines: http://forums.devx.com/showthread.php?t=130782 But doesn’t state how it is based on the ISO standard

  • Also, a search on Stack Overflow gave me results that weren’t quite what I was looking for: https://stackoverflow.com/search?q=iso+week

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:53:16+00:00Added an answer on May 31, 2026 at 3:53 pm

    Thanks @assylias – an answer in that question is pretty close, if not exactly what I’m looking for: https://stackoverflow.com/a/1226248/227926

    Note to use this solution I should add that you need to import the Calendar abstract class defintion:

    Imports System.Globalization
    

    AND then instantiate an Instance of Calendar, I chose Gregorian Calendar as it is the defacto standard, but there are other (cultural) options:

    Dim myCalendar As Calendar = New GregorianCalendar
    

    Then, to quote the solution ( https://stackoverflow.com/a/1226248/227926 ):

    You can use the Calendar.GetWeekOfYear method to get the week number
    of a date, with the CalendarWeekRule.FirstFourDayWeek value to specify
    how the weeks are determined, and DayOfWeek.Monday to specify the
    first weekday. That follows the ISO specification.

    Example:

    int week = myCalendar.GetWeekOfYear(DateTime.Today,
    CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);

    I will not mark my question as a duplicate, because their question title “Calculate the start and end date of a week given the week number and year in C# (based on the ISO specification)” is distinctly different from mine and they mention C# (not Visual Basic although they do want Visual Basic as well).

    Keeping my question present should help others in their search for the same.

    Thanks!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a bunch of posts stored in text files formatted in yaml/textile (from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.