OpenChronos
OpenChronos copied to clipboard
Could it be possible that the skew formula might be wrong?
Could it be possible that the skew formula might be wrong? More precisely if BASE_YEAR is 2001 then (pdate->year - BASE_YEAR)/4 does not kick in leap years but 1 year after, so it should be something like:
define BASE_YEAR 2001
u8 skew; skew = (pdate->year - BASE_YEAR)+(pdate->year - BASE_YEAR + 1)/4;
(easy test - set date to January 1st 2012, it should be SUN and not SAT).