Wrong Week number in %ww% Filename macro?!

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
kseemann
Posts: 3
Joined: Wed Oct 05, 2005 12:32 am

Wrong Week number in %ww% Filename macro?!

Post by kseemann »

Hi All,

I am using the %ww% Filename macro for a Report and Hostmonitor is one Week ahead...?

My Outlook and my printed Calendar both say "Week 40" for today (Oktober 5th). Hostmonitor (Ver. 5.38 ) says "Week 41"? Date, Time and Timezone are correctly set.

Are there different ways to calculate the "Week" (US vs. Germany)? Or is ist "just a Bug"?

Greetings

Kay
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I just calculated weeks manually ( using calendar :-) ), today - week #41
Unless you calculating starting from week #0

Regards
Alex
kseemann
Posts: 3
Joined: Wed Oct 05, 2005 12:32 am

Post by kseemann »

Hi Alex,

If i go "back in Time" in my Outlook calendar i see that the week 53 in the Year 2004 begins on 27th Dec. and ends with 2nd Jan. So the first week of the Year 2005 begins on the 3rd Jan. My printed calendar on my desk tells the same Story (and that calendar isn´t from Microsoft :wink: ).

There seems to be a ISO Standard for this stuff...
http://www.proesite.com/timex/wkcalc.htm

Greetings

Kay
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

In [ISO8601], the week number is defined by:
weeks start on a monday
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.)
This means that the days before week 1 in a given year are attributed to the last week of the previous year. Also the days that come after the last week of a given year are attributed to the first week of the next year.
H'm... may be its not a good idea use ISO for logs.
E.g. If you need to change log file every week and you want to keep separate folder for each year, you specify path like c:\hostmon\logs\%YYYY%\log%WW%.htm
What happens? Log for last week of 2004 can be saved as c:\hostmon\logs\2004\log01.htm !! There same problem for first week...
I mean if we use only %WW% variable, ISO can be used. But we often use other date variables together with %ww%. Here ISO is not good solution

Regards
Alex
Post Reply