iFirstWeekOfYear=0 instead of 2 on French XP system ???

  • Thread starter Thread starter Leto 58
  • Start date Start date
L

Leto 58

Hi,
The registry value for HKEY_CURRENT_USER\Control
Panel\International\iFirstWeekOfYear is '0' on my french XP system, what
means that week 1 always includes 1st of january.
However, France (as most of european countries) follows ISO rule, that says
that week 1 contains at least 4 days is the first week of that year (which is
iFirstWeekOfYear = '2')
It appears that this value can therefore not be trusted to implement a
"GetWeekNumber()" function that works for all countries.
Is this bug or is there something wrong in my regional settings ?

Thank you,
Regard,
Leto
 
Leto 58 said:
Hi,
The registry value for HKEY_CURRENT_USER\Control
Panel\International\iFirstWeekOfYear is '0' on my french XP system, what
means that week 1 always includes 1st of january.
However, France (as most of european countries) follows ISO rule, that
says
that week 1 contains at least 4 days is the first week of that year (which
is
iFirstWeekOfYear = '2')
It appears that this value can therefore not be trusted to implement a
"GetWeekNumber()" function that works for all countries.
Is this bug or is there something wrong in my regional settings ?

Thank you,
Regard,
Leto

The ISO standard you refer to does not appear to be implemented
in the current release of Windows. Here is a extract from the relevant
Excel help page:
================
The WEEKNUM function considers the week containing January 1 to be the first
week of the year. However, there is a European standard that defines the
first week as the one with the majority of days (four or more) falling in
the new year. This means that for years in which there are three days or
less in the first week of January, the WEEKNUM function returns week numbers
that are incorrect according to the European standard.
================
You may have to implement your own algorithm for your week
numbering system.
 
It was precisely when I tried and implement my own algorithm for week number
that I found this problem. It is OK for me to develop implementation for each
case:
- 0 Week containing 1/1 is the first week of that year.
- 1 First full week following 1/1 is the first week of that year.
- 2 First week containing at least four days is the first week of that year.

But I need to know at least which countries use which case.
If HKEY_CURRENT_USER\Control Panel\International\iFirstWeekOfYear returns
always "0", whatever the country, it is no longer a parameter but a constant,
and it should not even exist (it is just confusing).

Unless it is here for future use. But in the page "International
Features"/"Locale Information" of Microsoft Visual Studio 2005 documentation,
I can see no warning or remarks about the specifier LOCALE_IFIRSTWEEKOFYEAR
that says that it is not in used yet.

I can just conclude that Microsoft forgot to set this key to "2" before
shipping OS for European countries. But I would like to be sure of it.

Regards,
Leto
 
Leto said:
I can just conclude that Microsoft forgot to set this key to "2" before
shipping OS for European countries. But I would like to be sure of it.

It does say "2" on my System (German XP Pro SP2).


usch
 
Hi,
I just received a brand new PC with Windows Vista (not XP) French installed
on it (from Dell) , and HKEY_CURRENT_USER\Control
Panel\International\iFirstWeekOfYear says "0" !! , what confirms the bug.
Maybe it is just a "french" issue :-( ?
 
Back
Top