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 7542809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:15:59+00:00 2026-05-30T08:15:59+00:00

In the .Net-Framework there is a known bug when trying to calculate the weeknumber

  • 0

In the .Net-Framework there is a known bug when trying to calculate the weeknumber with ISO-8601.

Short-Description: “When determining the week number of a date according to the ISO 8601 standard, the underlying function call to the Oleaut32.dll file mistakenly returns week 53 instead of week 1 for the last Monday in certain years.” (Source: Microsoft)

My Question: Is this bug also ‘included’ in MonoTouch and I have to use the workaround, or is it fixed in MonoTouch? The MonoTouch-API-Reference is not a big help here…

UPDATE: As I was told in the comments I did a few tests on my own. Example-Code follows

        DateTime first = new DateTime(1851,12,29);
        DateTime second = new DateTime(2011,12,30);
        DateTime third = new DateTime(1895,12,30);

        System.Globalization.Calendar objCal = System.Globalization.CultureInfo.CurrentCulture.Calendar;
        int weekNumberFirst = objCal.GetWeekOfYear (first, System.Globalization.CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
        int weekNumberSecond = objCal.GetWeekOfYear (second, System.Globalization.CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
        int weekNumberThird = objCal.GetWeekOfYear (third, System.Globalization.CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);

        Console.WriteLine (weekNumberFirst +" "+weekNumberSecond+" "+weekNumberThird);

Supposed Output: 1 52 1
Actual Output: 53 52 53

But would still be nice, to have some “official statement” for this…

  • 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-30T08:16:01+00:00Added an answer on May 30, 2026 at 8:16 am

    I can confirm the bug exists in the latest MonoTouch versions.

    It’s unlikely to be fixed unless Microsoft fix their own implementation (I have not tested it on Windows) since Mono compatibility includes a number a bugs (to easy porting). However it would not be very hard to adjust your code to deal with both a working/buggy code base (so any future change won’t affect you).

    Note: This is only a semi-official statement. Official statements from any company will only come from official channels 😉

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

Sidebar

Related Questions

In the .NET framework there are a couple of ways to calculate an MD5
Occasionally I will know that there is a .NET Framework function that returns a
Does anyone know of any good tutorials on ADO.NET Entity Framework? There are a
From the first days the .NET framework came out there was a minimum OS
Are there any advantages compiling for .NET Framework 3.5 instead of 2.0? For example
Is there a way through the .net framework to determine if a folder is
Is there a way in the .NET framework to validate that a process has
Is there any class in the .NET framework that can read/write standard .ini files:
Is there a SSCLI equivalent for .Net Framework 3.5? Something that can be debugged
Maybe there are VB.net and other language that related with .Net framework. When I

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.