Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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.

↑ Back to the top


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

↑ Back to the top


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.

↑ Back to the top


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

↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 2228481
Revision : 1
Created on : 1/7/2017
Published on : 10/14/2010
Exists online : False
Views : 97