1 #ifndef JULIAN_H
2 #define JULIAN_H
3 
4 /* ============================================================================
5    $Id$
6    Julian Date Routines
7    Written 1999 by Tobias Ernst and release to the Public Domain.
8 
9    These routines calculate a Julian day number for a given date. Julian day
10    numbers are a consecutive sequence of day numbers, with the origin at the
11    January 1st, 4713 (B.C.) (Julian Day #1). Julian day numbers can be used to
12    calculate date differences in days (just subtract the day numbers), to
13    determine the day of week (julian day number modulo 7 yields 0 for Monday, 6
14    for Sunday), etc.
15 
16    The calculcations in these routines are based on the Gregorian calendar
17    being in effect since Oct. 15, 1582 (European convention). In any case,
18    result for dates previous to September 14, 1752, will probably not be too
19    much in coincidence with the local reality at that time.
20 
21    Conventions are: dd (day in month): 1 .. 31
22                     mm (month): January = 1, December = 12
23                     yy (year):  Positive four digit year number (e.g. 1999).
24 
25    The routines do not work year numbers < 1. There is no problem with big year
26    numbers, i.E. the code is year 2000 safe (and it of course respects Feburary
27    29, 2000).
28    ============================================================================
29 */
30 
31 long get_julian_date(int dd, int mm, int yy);
32 void decode_julian_date(long julian, int *dd, int *mm, int *yy, int *diny);
33 
34 long julian_today(void);
35 
36 #endif
37