?
Solved

Calculating calendar week numbers

Posted on 1998-02-03
11
Medium Priority
?
925 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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 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 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

Need protection from advanced malware attacks?

Look no further than WatchGuard's Total Security Suite, providing defense in depth against today's most headlining attacks like Petya 2.0 and WannaCry. Keep your organization out of the news with protection from known and unknown threats.

Question has a verified solution.

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

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…
New style of hardware planning for Microsoft Exchange server.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month10 days, 5 hours left to enroll

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