Skip to content

Instantly share code, notes, and snippets.

@willwright82
Created August 28, 2017 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willwright82/8b0e11f6485d1e3d972d6b6105edb47f to your computer and use it in GitHub Desktop.
Save willwright82/8b0e11f6485d1e3d972d6b6105edb47f to your computer and use it in GitHub Desktop.
Sakamoto Weekday
def calc_wday(year, month, day)
a = (14 - month) / 12
y = year + 4800 - a
m = month + 12 * a - 3
wday = day + (153 * m + 2) / 5 + 365 * y + y / 4 - y / 100 + y / 400 + 2
wday = wday % 7
return wday
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment