Solved

Calculating calendar week numbers

Posted on 1998-02-03
11
917 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 84

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
 

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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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 84

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 84

Accepted Solution

by:
ozo earned 10 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 84

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

Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

Join & Write a Comment

this article is a guided solution for most of the common server issues in server hardware tasks we are facing in our routine job works. the topics in the following article covered are, 1) dell hardware raidlevel (Perc) 2) adding HDD 3) how t…
This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now