| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.10

 

week_of_year

#include "sfldate.h"
int
week_of_year (long date)

Synopsis

Returns the week of the year, where 1 is the first full week. Week 0 may or may not exist in any year. Uses a Lillian date algorithm to calculate the week of the year.

Source Code - (sfldate.c)

{
    long
        year = GET_CCYEAR (date) - 1501,
        day  = year * 365 + year / 4 - 29872L + 1
             - year / 100 + (year - 300) / 400;

    return ((julian date (date) + (int) ((day + 4) % 7)) / 7);
}

| << | < | > | >> iMatix Copyright © 1996-99 iMatix Corporation