2

When I set a Windows' Regional format to English (Sweden) (and same applies to e.g. Czech format) the last week of the year is 52 and new year start with week 1. Start of week is by default on Monday.

enter image description here

When I set a Windows' Regional format to English (Europe) (and same applies to e.g. Romanian format) the last week of the year is 53 and new year start with week 2. Start of week is by default on Sunday, but I have switched it to Monday (although the change has no effect on the calculation of the week number in this case).

enter image description here

I expect the week number would depend on what each country uses as beginning of week, but it just seems random? Sweden and Czechia use Monday as beginning of week and their calculation is the same. But Romania (and most of Europe) also use Monday as beginning of week, then why is the week number different?

I understand there is a difference in how Gregorian calendar and ISO8601, but according to this question if Windows is using only Gregorian, why does the calculation change?

Furthermore, what setting do I need to change, to affect this, other than changing the whole region?

rancor1223
  • 356
  • 2
  • 16
  • I do not know how you check if you got the correct week number. But some calendars use different week numbering schemes. This means that the week number can be offset by one, depending on how they define, when a year has 53 weeks. – GoWiser Aug 30 '21 at 12:59
  • `Week number` isn't unique. The number depends on what is considered Week 1, in case a year starts in the middle of the week (as most do). Does that first partial week count as Week 1 of the next year or Week 53 of the previous one? In ISO 8601 Week 01 is `the week with the first Thursday of the Gregorian year`. This means that `January 1` can end up in Week 53 of the previous year – Panagiotis Kanavos Aug 30 '21 at 13:13
  • Different countries may use different "official" week numbering schemes, just as they use different formats. Or there may not be any official week number scheme, in which case Windows uses a default one. – Panagiotis Kanavos Aug 30 '21 at 13:19
  • @PanagiotisKanavos I think you misunderstood my first comment. When I wrote "I do not know how you", I meant "you = the author of the question". I do not know how he gets his "correct" week number. From a paper calendar? From windows configured with his own region? Or whatever. And in my suggested answer, I inform him that there is no such thing, as a correct week number, across regions – GoWiser Aug 30 '21 at 21:21

1 Answers1

1

The following is from What Are Week Numbers?.

Monday or Sunday First?

There are at least six different week numbering systems currently in use around the world.

The most common is the International Standard ISO 8601, where Monday is the first day of the week followed by Tuesday, Wednesday, Thursday, Friday, Saturday, and with Sunday as the seventh and final day. Using ISO 8601 can help diminish uncertainty and confusion when communicating internationally.

Not ISO 8601 in US & Canada

However, not every country follows this standard. Several countries, including the United States, Canada, Australia, and New Zealand, put Sunday at the start of the week on their calendars.

Which Years Have 53 Weeks?

The weeks of the year in a Gregorian calendar are numbered from week 1 to week 52 or 53, depending on several varying factors. Most years have 52 weeks, but if the year starts on a Thursday or is a leap year that starts on a Wednesday, that particular year will have 53 numbered weeks. These week numbers are commonly used in some European and Asian countries; but not so much in the United States.

Other issues

Some calendars just get it wrong, so checking your calculations against it, will cause confusion.

If you want to use the regional windows settings of each user, then your week numbers will not match, if you have user's in different regions, that use different week numbering schemes.

Alternative solution

The solution is to not use week numbers at all, but to specify weeks by their start- and end-dates.

GoWiser
  • 857
  • 6
  • 20
  • That's not a good explanation. Two different week numbers are used in all countries, depending on what is consider `Week 1` should a year start in the middle of the week. Is `Thursday, January 1` Week 1 of the new year or Week 53 of the old one? What about Wednesday? – Panagiotis Kanavos Aug 30 '21 at 13:12
  • But 2022 doesn't start neither on Thursday, nor on Wednesday. And while Windows could be wrong, I find that rather unlikely. – rancor1223 Aug 30 '21 at 13:12
  • @rancor1223 I've been in the same hell as you and the solution is to stick to a specific method of calculating the week, and communicate clearly to your users, which methhod you use. If you use the default regional settings for windows, then communicate it to your customers, to avoid confusion. – GoWiser Aug 30 '21 at 13:15
  • @rancor1223 If you want to use the regional settings of the user, then your week numbers between users from different regions will not match, if you have user's in different regions, that use different week numbering schemes. I will add this to my answer. – GoWiser Aug 30 '21 at 13:18
  • @PanagiotisKanavos Feel free to edit my answer or post your own. I have encountered this problem multiple times, with multiple costumers. And my advice to them has been to not use week numbers, if they want to communicate clearly. I have even seen different standards used, within the same country. – GoWiser Aug 30 '21 at 13:36
  • I don't get it: how can a year have 52 weeks when 52*7 = 364? what week num is the 365th day? – Gian Paolo Aug 30 '21 at 14:10
  • @GianPaolo Each year, the extra day or two (leap year) accumulates, and when too many days have accumulated, you get a year with 53 weeks, roughly every 6 years, the other years have 52 weeks only. – GoWiser Aug 30 '21 at 14:39
  • @Gowiser, let's say week starts on Thursday, and 1st jan is Thursday, week 1. 30th dec is Wednesday, week 52. What about 31st dec? week 53? if 1st jan is Tuesday, you start counting weeks from Thursday 3rd? 1st and 2nd jan, which week are they? – Gian Paolo Aug 30 '21 at 18:14
  • @GianPaolo It depends on the method you use to calculate the week number, as described in my comments and answer. If there was a single answer, for example ISO 8601, then there wouldn't be any confusion, but there are many answers to your question. No matter which method you chose, it will be wrong in one or more regions. That is why I suggest, that we suggest to our customers/users, to use date intervals instead of week numbers. Pick your poison. – GoWiser Aug 30 '21 at 20:59