Hello Stevenson, Jonathan, in a previous mail you wrote:

> Hi,
> 
> I've just had a problem related to the Date::Calc modules calculation of week 
>numbers, as some of my data suppliers are obviously using a different algorithm to 
>calculate week 1 of a year - they define dates which fall into week 1 of 2003 
>according to Date::Calc as week 53 of 2002.
> 
> I need to know the criteria for defining week 1 of a year according to Date::Calc to 
>check which data suppliers match, and which I need to create custom week number 
>generators for. From the documentation, I suspect it might be the week containing the 
>1si of January, with Monday defined as the first day of a week, but I can't find it 
>confirmed anywhere. Does anyone know what it uses? 

I'm sorry if I forgot to include this information in the module's
documentation.

The algorithm (to be confirmed at
http://www.engelschall.com/~sb/download/Date-Calc/DIN1355/)
is defined as follows:

1) Monday is the first day of a week.
2) Is considered the first week (#1) of a year
   the week which contains at least 4
   of the first 7 days in January.

2') Equivalent is: The first week is the one which
    contains the first Thursday of the year (because
    when Monday is the first day of a week, Thursday
    is the day in the middle of the week) and thus
    belongs to the year in question by more than a half.

> Thanks for your help,
> Jon Stevenson 

Hope this helps! :-)

Best regards,
-- 
    Steffen Beyer <[EMAIL PROTECTED]>
    http://www.engelschall.com/u/sb/whoami/ (Who am I)
    http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
    http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)

Reply via email to