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

 

julian_date

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

Synopsis

Returns the number of days since 31 December last year. The Julian date of 1 January is 1.

Source Code - (sfldate.c)

{
    static int
        days [12] = {
        0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
    };
    int
        julian;

    julian = days [GET_MONTH (date) - 1] + GET_DAY (date);
    if (GET_MONTH (date) > 2 && leap year (GET_YEAR (date)))
        julian++;

    return (julian);
}

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