I am suspecting both AMP Calendar and AutoHotkey to rely on Windows' API to get the date information, not calculating manually.
For the record, I found an interesting article:
Calculating the ISO week number which defines "
week 1 of a given year is the one that includes the first Thursday of that year. (or, equivalently, week 1 is the week that includes 4 January.)", so, indeed, according to this rule, this year's first week starts on January 4.
I was wondering about your post because I have AMP Calendar (a good, lightweight application) and I ran your script.
Both correctly report first week starting on January 4...
Then I had a suspicion... I went to the computer of my wife, running Windows 7. Lo! The calendar utility shown week 1 on first day of January...
I don't know which system they use (apparently there are several...) but it is.. disconcerting! It won't ease communication between one person on Windows XP (like me) and Windows 7! ("the deadline is set on week 11")...
Well, the conclusion is that this is not a bug in AHK...
[EDIT] For the record, it seems to be an old problem with MS products...
See
Week numbers in Outlook Calendar are not consistent with Europe and
Outlook 2002 shows wrong week numbers (last message, particularly: looks like we can change that in Outlook).
Apparently,
Windows 7 beta has No week numbers in calendar, but they fixed that later, but incorrectly as it seems... Or inconsistently. Note that XP doesn't show week numbers either. I also notice: we have a calc, but no cal out of the box (beside these dialogs to change date/time)?
See also
CalendarWeekRule Enumeration (found that by looking at the
Determining the week number of 31/12/2008, because .NET is wrong thread where I found three links to various bug reports at Microsoft's site, with confusing answers from Microsoft...).
Apparently, the rules are culture dependent (as I guessed) and thus depend on the chosen parameter.
I still think it is strange to have differences between Windows XP and 7 (for the same locale, French in my case!).