Algorithm problem

Looking for an algorithm to compute the number of days between two given dates I came across a professor's C program located here: http://cr.yp.to/2001-275/struct1.c

I was wondering if anyone could tell me where the value 678882 in the line

int d = dateday - 678882;

comes from and also the line

d += (306 * m + 5) / 10;

where these numbers come from and their purpose.

Thanks.

The code is doing civil date to Julian date conversion, then subtracting. Julian date algorithms are, um, interesting. The big numbers relate to the epoch used for the calculation vs the data range expected in the civil calendar. I don't know where his particular numbers came from.

See:

http://scienceworld.wolfram.com/astronomy/JulianDate.html