Skip to content

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

Description

@catalinus

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions