Created
August 28, 2017 11:13
-
-
Save willwright82/8b0e11f6485d1e3d972d6b6105edb47f to your computer and use it in GitHub Desktop.
Sakamoto Weekday
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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