Created
May 18, 2010 21:02
-
-
Save webdood/405545 to your computer and use it in GitHub Desktop.
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
var day_by_date = function(y, m, d){ | |
return (d+=m<3?y--:y-2,Math.floor(23*m/9)+d+4+Math.floor(y/4)-Math.floor(y/100)+Math.floor(y/400))%7; | |
}; | |
['sun','mon','tue','wed','thu','fri','sat'][day_by_date(1987, 9, 10)] | |
from clindsey |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Figures out the day of the week without using a Date object. Not sure why this is useful, but it's cool that it works!