Skip to content

Instantly share code, notes, and snippets.

@Koitaro
Created September 25, 2009 12:38
Show Gist options
  • Save Koitaro/193511 to your computer and use it in GitHub Desktop.
Save Koitaro/193511 to your computer and use it in GitHub Desktop.
# Zeller's congruence
# 0 => Sunday
proc zeller {y m d} {
set t {0 3 2 5 0 3 5 1 4 6 2 4}
if {$m < 3} { incr y -1 }
expr {($y + $y/4 - $y/100 + $y/400 + [lindex $t $m-1] + $d) % 7}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment