## Re:Calculate week-number

##### Quote

On Tue, 08 Jul 1997 14:39:30 +0300, BINAS <bi...@xs4all.nl> wrote:

>Could anyone give the formula to calculate the number of the week given

>a certain date.

The definition of week number varies from place to place. By ISO

standards, weeks run Monday to Sunday. For any given year, the first

week that includes a Thursday (the middle of the week) is numbered

week 1. If there are any days in the year for the preceding week,

that is week 0.

In contemporary American usage, weeks run Sunday to Saturday. The

first week with a Sunday is week 1.

Another common usage is to let weeks run from whatever weekday 1 JAN

falls upon for 7 days. This makes the weeknumber easy to compute

since it is the (ordinalday + 6) div 7.