How many weeks in a year


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How many weeks in a year
# 1  
Old 06-28-2004
How many weeks in a year

Hi,

I search how i could do to find if a year (for example 2004, 1989, 2058) has 52 or 53 weeks...
Have you a idea for me please???
# 2  
Old 06-28-2004
Navigate:
Our Home Page -> Answers to Frequently Asked Questions -> Yesterdays Date/Date Arithmetic

and take a look at my datacalc routine.

Try to compute the Modified Julian Date of February 29 of the year in question. If you succeed you have a leap year which has too many days to be only 52 weeks.

A non-leap is 364 days which is exactly 7 * 52. In my mind such a year is always 52 weeks in length. But to determine if the year exactly comprises 52 weeks each starting with Sunday, compute the Day of the Week of Jan 1. If Jan 1 is a Sunday, the anwser is yes.
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Best way to increment weeks based on fiscal start year

Hi Folks - I'm looking for the best way to to increment fiscal weeks - allow me to explain. At my one client, 10/01/17 was the beginning if year fiscal year 2018. Each week, I need to manage a unique set of variable that are updated in my application - they are called substitution variables.... (31 Replies)
Discussion started by: SIMMS7400
31 Replies

2. Shell Programming and Scripting

How to calculate the total number of weeks from a specify year?

Hi anyone can help? How to calculate total number of weeks from a specify date, for example, 01 Jan 2012. Thx! (2 Replies)
Discussion started by: rayray2013
2 Replies

3. Shell Programming and Scripting

Last weeks date

I am unable to get the last week date i tried to use the following commands but i failed Please help, and am using HP unix date -d "+1 week" date --date=yesterday +%y%m%d (5 Replies)
Discussion started by: jhon1257
5 Replies

4. AIX

How to check changes made in last few weeks?

Hi, I want to know what changes were made to my AIX system in last few weeks/months. Is there any command that I can use for this? I am facing a problem wherein my program which are built few weeks back runs fine but if I build the same program now, it doesn't run as expected. ... (4 Replies)
Discussion started by: shriashishpatil
4 Replies
Login or Register to Ask a Question