Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compute week number.
#5
Ted, you wrote:
"For instance the 6th day of the year would = 6 \ 7 . So you are in the first week."

Actually, the 6th day of the year is in the second week for 2008.

You're on the right track, but your integer division of the day of the year is missing a key factor, which is: the day of the week (1 to 7) of January 1st of the subject year.

Before integer dividing by 7, you must add the day of the week of Jan 1st, minus 2, to the day of the year of the subject date. After the integer division, you must add one to the result to get the correct week number.

As you can see, this issue gets more and more complicated.

Regards..... Moneo
Reply


Messages In This Thread
Compute week number. - by Moneo - 07-06-2008, 05:39 AM
Re: Compute week number. - by Clippy - 07-23-2008, 05:03 AM
Re: Compute week number. - by Moneo - 07-24-2008, 07:39 AM
Re: Compute week number. - by Clippy - 07-25-2008, 01:14 AM
Re: Compute week number. - by Moneo - 07-25-2008, 06:07 AM
Re: Compute week number. - by Clippy - 07-26-2008, 12:08 AM
Re: Compute week number. - by Moneo - 07-27-2008, 11:46 PM
Re: Compute week number. - by Clippy - 07-28-2008, 11:29 PM
Re: Compute week number. - by Moneo - 07-29-2008, 05:05 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)