supportlink
Mark GOODMAN
mark.goodman@coats-viyella.com
Wed, 07 Jul 1999 11:10:57 GMT
Hello All,
I've sent the below to Johan, but didn't send it to the whole group. This is a
copy of the article.
Regards Mark
> Define date_in date century included = parm prompt "Enter Date: "
>
> ; Calculate date of January 1st of current year
>
> Define date_yyyy0101 date century included &
> = floor ( date_in / 1000 ) * 10000 * 101
>
> ; Calculate date of Monday week number 1 of current year
> ;
> ; if January 1st is a: then week number 1 starts on (difference)
> ; Monday then same date 0
> ; Tuesday December 31st previous year -1
> ; Wednesday December 30th previous year -2
> ; Thursday December 29th previous year -3
> ; Friday January 4th +3
> ; Saturday January 3rd +2
> ; Sunday January 2nd +1
>
> Define date_mon_week_01 daet century included &
> = date ( days (date_yyyy0101 ) &
> + 2 - mod ( days (date_yyyy0101 ) -5 , 7 ) )
>
> ; Calculate date of monday week number 1 of previous year
>
> Define date_mon_week_01_py date century included &
> = date ( days (date_yyyy0101 - 10000 ) &
> + 3 - mod ( days ( date_yyyy0101 - 10000) -5, 7 ) )
>
> ; Calculate date of Monday week number 1 of next year
>
> Define date_mon_week_01_ny date century included &
> = date (days (date_yyyy0101 + 10000 ) &
> + 3 - mod (days (date_yyyy0101 + 10000 ) -5 , 7 ) )
>
> ; Now its time to calculate the week number
> ;
> ; We have to find out which interval of the Monday dates our date is ,
> ; and calculate the week number from the correct Monday
> ;
> ; Week number format : YYYYWW
> ;
> ; YYYY Year including century
> ; WW Week number (1....53)
> ;
>
> Define week_no number*6 &
> = ( floor ( date_yyyy0101 / 10000 ) * 100 &
> + floor ( ( days ( date_in ) - days (date_mon_week_01 ) ) / 7 ) + ) &
> if date_mon_week_01 <= date_in < date_mon_week_01_ny &
> else ( floor ( date_yyyy0101 / 10000 ) * 100 - 100 &
> + floor ( ( days (date_in ) - days ( date_mon_week_01_py ) ) / 7 ) + 1 ) ) &
> if date_in < date_mon_week_01 &
> else ( floor (date_yyyy0101 / 100000 ) * 100 + 100 &
> + floor ( ( days ( date_in ) - days ( date_mon_week_01_ny ) ) / 7 ) + 1 )
>
> ;
>
> report date_in week_no
____________________Reply Separator____________________
Subject: supportlink
Author: "Johan Koelewijn" <johan@vandijkgroep.nl>
Date: 06/07/99 12:25
Hello,
I am looking for an article in supportlink volume 6 no 1 (page 25) about
calculating week numbers.
Does anyone have this information for me ? (or another method for
calculating week numbers). I found an article in volume 5 no. 5 but that
one is not ok.
Thanks,
Johan Koelewijn
Van Dijk Delft BV
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.