Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could it be possible that the skew formula might be wrong? #29

Open
catalinus opened this issue Jun 24, 2011 · 0 comments
Open

Could it be possible that the skew formula might be wrong? #29

catalinus opened this issue Jun 24, 2011 · 0 comments

Comments

@catalinus
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant