Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

191
Visualizações
Winforms DateTimePicker - Wrong week number

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?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

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.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda