Solved

Calculating calendar week numbers

Posted on 1998-02-03
11
923 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: 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 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

What do we know about Legacy Video Conferencing? - Full IT support needed! - Complicated systems at outrageous prices! - Intense training required! Highfive believes we need to embrace a new alternative.
In the modern office, employees tend to move around the workplace a lot more freely. Conferences, collaborative groups, flexible seating and working from home require a new level of mobility. Technology has not only changed the behavior and the expe…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

739 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