GetLocaleInfo returns unexpected values for LOCALE_IFIRSTWEEKOFYEAR

Symptoms

Depending on the regional settings you choose, there can be differences in how the FirstWeekOfYear is treated. Either this can be the week 
with the first 4 days in the new year or the week with the 1th January. There may be unexpected result when querying this value for 
some regions. This may cause the application to not work properly with the expected first calendar week of the year.

Cause

All applications query this information from a registry key value within the regional settings of the user profile.

HKEY_CURRENT_USER\Control Panel\International\iFirstWeekOfYear

The valid settings of this value are the following.

0 - Week containing January 1 is the first week of the year
1 - First full week following January 1 is the first week of the year
2 - First week containing at least four days is the first week of the year

Resolution

To customize this behavior for a certain application, this value can be adjusted to the desired setting. This change does not require a reboot or new logon. Only the above mentioned values are supported and all others are ignored.

More Information

Detailed information's on the GetLocalInfo API can be found in the Microsoft Platforms SDK Collection and the MSDN.

http://msdn.microsoft.com/en-us/library/dd318101(VS.85).aspx
Propiedades

Id. de artículo: 2228481 - Última revisión: 14 oct. 2010 - Revisión: 1

Comentarios