[EMAIL PROTECTED] wrote:
> Barry:
> 
> This is what I use to meet the ISO
> 
> Bill
> 
> SUBROUTINE WEEKNO (DateIn, WeekOut)
> **
> ** Notes:
> **
> ** Passed Variables:
> **    DateIn       :  Internal date representing week number desired
> **    WeekOut      :  ISO 8601-formatted Week Number:
> **
> ** ISO 8601 prescribes a format yyyyWnn, where nn is the ordinal week
> ** number in the year, and the rule is that week 01 in a year is the
> ** first week that contains four calendar dates in that year.
> **
> ** A week is defined as a seven-day period running from Monday-Sunday.
> ** Week 1 of any year is defined as the first week containing four days
> ** of the year, or equivalently the week containing the first Wednesday
> ** of the year. For example, if January 1 falls on a Friday, then the
> ** first two days of January fall in week 53 of the preceding year.
> **
BIG BIG WHOOPS !!!!

It's Thursday, not Wednesday. Let's take the case of "Wed, 31 Dec". Your 
wednesday rule makes it week 53. But Thu,Fri,Sat,Sun are all in the following 
year, ie 4 days, ie a majority, which makes it ISO week 1.

Cheers,
Wol
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to