?
Solved

Calculating calendar week numbers

Posted on 1998-02-03
11
Medium Priority
?
927 Views
Last Modified: 2012-06-27
I'm developing a time-sheet form for work.

However, after looking at diaries from several years (and the Web), I can't actually determine how the week number is actually derived.

I thought that Week 1 would be the week in which Jan 1st fell - but no!!

Some years also have 53 weeks!!!

Oh Father Time, reveal thy secrets.
0
Comment
Question by:Noggy
11 Comments
 
LVL 85

Expert Comment

by:ozo
ID: 1018061
0
 

Expert Comment

by:surgeman
ID: 1018063
Trivia:
Every year divisable by 4 is a leap year;  EXCEPT those years
divided by 400 are not.  In otherwords ladies and gentlemen,
the year 2000 is NOT a leap year.
0
 
LVL 2

Expert Comment

by:AlFa
ID: 1018065
there is an algorithm for that. I remember i've got it in a ti59 or ti58 manual.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:rndavis
ID: 1018066
What is a ti59 or ti58 manual?
0
 
LVL 3

Expert Comment

by:braveheart
ID: 1018067
Week number is not a universally defined concept. You could invent your own system if you liked but I guess you are trying to mimic the system already in place at work.

You might find that week 1 is the week in which the first Sunday (or Monday) of the year occurs. This would mean that any days prior to this would fall in week 0. You might also find that some other date is used as a datum, such as the end of the tax year or Christmas Day.
0
 
LVL 4

Author Comment

by:Noggy
ID: 1018069
I agree with Martike, Ozo had the answer in the first place as regards time. You should submit yours as the answer, Ozo!!

Martike, your comment regarding the year was correct (I already actually knew this one) unlike Surgeman's. Thank you for all your comments though.

As to where I was, I was monitoring the comments/answers from my work's logon to experts-exchange. I got what I wanted from Ozo's comment and was waiting (and hoping) that he submitted as the answer.

As a result, I'll give hime another day to claim his prize. If he doesn't, then you can have it, Martike, if you submit it as the answer, that is.
0
 
LVL 85

Expert Comment

by:ozo
ID: 1018070
martike is right about leap years.

But the usual argument for neglecting 1999-12-31 24:00:00, that "there was no year 0"
seems rather silly to me.   There was no year 1 either.
It was not until many years later that the year 1 was retroactively designated.
1-1-1 00:00:00 was not celebrated as the dawn of a millenium,
at the time, it wasn't even considered the start of a new year.
0
 
LVL 4

Author Comment

by:Noggy
ID: 1018072
And they would have sorted out the Millenium Bug one thousand years ago!!
0
 
LVL 85

Accepted Solution

by:
ozo earned 40 total points
ID: 1018073
Bah!-)
Zero exists in our numbering system now, and a year 0 can be designated as easily as 1 or 2525 or -99
(I won't quibble about whether 0-99 should be the 1st century or the 0th :-)

I didn't see Noggy's comment before my last post, so here is a summary of the answer:

Week 1 is the week containing 4 January, the first week with a majority of it's days in the new year.
0
 
LVL 4

Author Comment

by:Noggy
ID: 1018074
Well done & congratulations (for a measly 10 credits!!).

I still don't know why you didn't post it as an answer in the first place, it was just what I wanted. Maybe I didn't word it correctly (or you didn't care for the points!).

I would like to take this opportunity to thank you all for your comments\answers\discussion - I think this question is quite well flogged for this year!!

Thanks again.

Nog :->
0
 
LVL 85

Expert Comment

by:ozo
ID: 1018075
You're welcome.

Your question seemed to be worded clearly enough, but I've been mistaken before when I thought
I understood what a question was asking, so I didn't know that it was just what you wanted
until I saw your comment.
(and, yes, the risk of missing out on the points didn't seem too intolerably tragic:-)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
New style of hardware planning for Microsoft Exchange server.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Screencast - Getting to Know the Pipeline
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question