Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getWeekDay(nY, nM, nD)
- if not nD then
- return false, "getWeekDay(year, month, date)"
- end
- local a = math.floor((14 - nM) / 12)
- local y = nY - a
- local m = nM + 12 * a - 2
- local d = (nD + nY + math.floor(nY / 4) - math.floor(nY / 100) + math.floor(nY / 400) + math.floor((31 * m) / 12)) % 7
- return d
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement