Code Snippets > Misc ( Created 23 November 2008 | Last Edited 23 November 2008)

 Day of the Week by Evil Roy Ferguson | No VotesReturns the day of the week that an arbitrary date fell on, using Zeller's Congruence. Written inBlitz ; This function returns the ISO weekday of the given calendar date, ; using Zeller's congruence. ; (1 is Monday, 7 is Sunday.) Function DayOfTheWeek(day, month, year) ; Algorithm considers Jan/Feb to be months 13 and 14 of previous year. If month < 3 month = month + 12 year = year - 1 EndIf ; For readability's sake. Local century = year / 100 Local year_cent = year Mod 100 ; Find the weekday using Zeller's congruence. Local weekday = day + (26*(month+1))/10 + year_cent ; Account for leap year. weekday = weekday + year_cent/4 + century/4 + 5*century ; It's not Pluterday. weekday = (weekday + 5) Mod 7 + 1 Return weekday End Function -->

There are no comments for this entry. -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 511|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
 Latest PostsShoutbox Topic - 638 rockford Fri 05:49 Nintendo Switch GfK Fri 05:35 Don't Stream That Scene Jayenkai Fri 05:05 Siri Where'd I park my car? : BOOM! GfK Fri 04:18 AGameAWeek : 2016 - Part Two Jayenkai Thu 06:51 Chuck Berry - New Album rockford Thu 06:48 Bank Error in Kuron's Favor : Collect \$194 rockford Thu 02:21 Happy Birthday Rychan steve_ancell Wed 14:12 You Have 3 Voice Messages.. steve_ancell Wed 14:09 What gets on your goat about being [Insert nationality here] Kuron Wed 13:40 More

 Latest Items Woot : Getting Noticed... for Gameboy Dev!Jayenkai Sun 10:03 Dev-Diary : 1st Ever Wed Workshop Progresszzoom Thu 23:12 Showcase : Biomorph FractalsAndy_A Wed 12:43 Snippet : Fisheye Lens EffectJayenkai Wed 11:50 Snippet : 2D BallsJayenkai Wed 06:22 Showcase : Mining Map AI DemoStealth Tue 19:41 Showcase : Biotic Limit - Games For Better (2 Days) Editionrychan Mon 12:27 Dev-Diary : Intellivision Controller Adapterspinal Sun 11:33 Snippet : Contour Map from DataHoboBen Fri 18:14 Snippet : FPS Control (WASD+Mouse)Pakz Wed 22:30 Article : Concurrency in C#Afr0 Sun 12:28 Snippet : Mandelbrot in BMaxJayenkai Sun 03:37 News : Newsletter #281HoboBen Fri 04:18 News : Newsletter #280Jayenkai Sat 05:10 Blog : Monkey-X Box2D: Learning from my perspective... Hopefully!steve_ancell Sun 14:49More

Who's Online
Pakz
Fri, at 06:54
GfK
Fri, at 06:01
rockford
Fri, at 05:49
Jayenkai
Fri, at 05:33
spinal
Fri, at 05:32
Kuron
Fri, at 04:56
shroom_monk
Fri, at 04:46
HoboBen
Thu, at 19:48
LineOf7s
Thu, at 18:54
zzoom
Thu, at 16:57