Julian days.
This commit is contained in:
parent
e33dcbea67
commit
a9c04a1924
@ -1,3 +1,11 @@
|
||||
/** Tyler Durden: calculates a day number according to the Gregorian calendar. */
|
||||
function g(y,m,d)
|
||||
m = (m + 9) % 12
|
||||
y = y - m/10
|
||||
return 365*y + y/4 - y/100 + y/400 + (m*306 + 5)/10 + ( d - 1 )
|
||||
|
||||
Difference between two dates = g(y2,m2,d2) - g(y1,m1,d1)
|
||||
|
||||
/** Tomohiko Sakamoto comp.lang.c 1993-04-10. */
|
||||
static unsigned weekday(union date32 d) {
|
||||
d.year -= d.month < 3;
|
||||
|
Loading…
Reference in New Issue
Block a user