HP3000-L Archives

January 2003, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Tom Emerson <[log in to unmask]>
Reply To:
Tom Emerson <[log in to unmask]>
Date:
Tue, 7 Jan 2003 13:02:03 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (66 lines)
 [posting via the newsgroup -- seems about half of my e-mail replies actually
"make it" to the list, the others mysteriously time out -- as most posts
have been "OT", I generally don't worry, but this one actually deals with a
computer topic.  Eventually the e-mail may go through, so this may
duplicate...]

On Tuesday 07 January 2003 9:23 am, Michael Anderson wrote:
>
> Without thinking about it, so I could be mistaken, this is where I
> would start.
>
> :SETVAR MYWEEKOFYEAR (HPDOY / 7) + 1
> :ECHO !MYWEEKOFYEAR
>
> 2
>
> This logic should get you through this year. However, it's probably
> more reasonable to make the '+ 1' into a variable, that is set to 1 or 0
> depending on if the 7th of Jan is part of the 1st week of the year or
> not.

The thing that mucks this up is the determination of "week 1" -- there is a
business rule or two that might be a cause of conflict.  One rule I've heard
is the first week of the year is the "first week to contain a ..." [monday,
friday, sunday -- pick one...] an alternative rule is that the first week is
the first sunday-to-saturday stretch with 4 or more january days in it, so
if
the week "begins" on a thursday, friday, or saturday, it really is/was "part
of last year"...

it looks like microsoft agrees with me...

[long "google cached" version of website]
http://216.239.33.100/search?q=cache:8rGtI1gLgx8C:msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemglobalizationcalendarweekruleclasstopic.asp+first+week+of+year&hl=en&ie=UTF-8

[actual url]
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemglobalizationcalendarweekruleclasstopic.asp
[the page is failing to load at the moment, hence the long google-cached
version]

OTOH, I'm slightly off in regards to the "ISO" definition -- see
http://www.cl.cam.ac.uk/~mgk25/iso-time.html
which defines "the first week of the year" thusly:

     In commercial and industrial applications (delivery times, production
     plans, etc.), especially in Europe, it is often required to refer to a
     week of a year. Week 01 of a year is per definition the first week that
     has the Thursday in this year, which is equivalent to the week that
     contains the fourth day of January. In other words, the first week of a
     new year is the week that has the majority of its days in the new year.
     Week 01 might also contain days from the previous year and the week
     before week 01 of a year is the last week (52 or 53) of the previous
year
     even if it contains days from the new year. A week starts with Monday
     (day 1) and ends with Sunday (day 7).

[I defined a week as a "sunday-to-saturday" stretch, the page above
explicitly
states "weeks begin on mondays", hence the difference]

So, long story short, taking the "int" of the day-of-year divided by 7 and
adding an offset to correct for "week 1" seems to be the way to go :)

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2