Subject: Re: Get Start Date of a Week Number From: John Yeung Date: Mon, 1 Dec 2014 11:32:34 -0500 List-archive: List-help: List-id: Midrange Systems Technical Discussion List-post: List-subscribe: , List-unsubscribe: ,

On Mon, Dec 1, 2014 at 9:36 AM, <rob@xxxxxxxxx> wrote:
Always allow for 53 weeks. It happens at least every ?5? years. Think:
Is 365.4 divisible by 7? No, it's 52.2. So (5 years) * (.2 weeks/year) =
1 extra week every 5 years. We used to do 13 four week period years and
every 5 years we had one 5 week period.

The main message is spot-on. Definitely allow for 53 weeks.

I have a quibble with 365.4. Where does that come from?

The naive notion of "leap year every four years" (as used by the
Julian calendar; i.e. the calendar instituted by the Roman emperor
Julius Caesar) would result in an average yearly length of 365.25
days. Add in the Gregorian refinements and you get 365.2425. The
vast majority of the world still uses this today, and it's the
internationally accepted standard.

The 53-week year happens at *most* every 5 years. Sometimes a long
ISO year occurs 6 years after the previous one, and once every 400
years, the long ISO year comes 7 years after the previous one. A
total of exactly 17.75% (71 out of 400) of all ISO years are 53 weeks
long.

For date math geeks:

http://www.staff.science.uu.nl/~gent0113/calendar/isocalendar.htm

And, depending on which function you use, there can be 54 weeks!

For me, this is reason enough to stick with WEEK_ISO, to ensure no
more than 53 weeks.

John Y.