home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
C
/
JULCAL10
/
README
< prev
next >
Wrap
Text File
|
1992-12-22
|
928b
|
20 lines
The standard C library routines for dates tend to fail before Jan 1,
1970. These routines let you do date calculations back to 4713 B.C.
using an ordinary struct tm.
juldn() calculates for a given date the Julian date (days since Jan 1
4713 B.C.). julcd() calculates the date (either Gregorian or Julian
calendar, with an arbitrary transition date) for a given Julian date.
In either case, the date is supplied in a struct tm.
Like mktime(), juldn() has the side effects of normalizing the values
of the fields tm_mday and tm_mon if they are outside their normal
ranges, and of setting the fields tm_wday (day of week) and tm_yday
(day of year). However, mktime() is one of the functions that usually
fails before 1970, and the implementations I tested didn't normalize
correctly, sometimes making spectacular errors (notably Borland's).
- Jim Van Zandt <jrv@mitre.org>