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 650|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
 Latest PostsAny Feature Requests? Kuron Fri 23:09 More Monkey Madness - With Ducks therevillsgames Fri 20:23 Arms on Switch Jayenkai Fri 18:30 Time for a new Android Test Doohickey Jayenkai Fri 09:26 CSS-Me-Do - SoCoder2 Jayenkai Fri 06:28 Pillowcases for kids! rockford Thu 16:15 Manchester Arena Explosion Jayenkai Thu 02:04 Buy Zelda spinal Wed 11:31 Family Jayenkai Wed 04:06 RIP - Sir Roger Moore rockford Tue 15:56 More

 Latest Items Showcase : Hiveszzoom Fri 16:10 Dev-Diary : My Journey into NES Developmentrychan Thu 12:31 Showcase : FlappadiddleJayenkai Sun 14:39 Snippet : QFindJayenkai Sun 13:02 Showcase : Tiny BlocksJayenkai Sun 04:08 Showcase : Read Error Arychan Fri 05:13 Blog : All my makes!Jayenkai Tue 05:48 Showcase : Infinitronrychan Mon 18:03 Showcase : Quadobanrskgames Fri 10:11 Blog : My Arduino experience.steve_ancell Wed 17:02 Showcase : Roguelike ExplorerPakz Fri 06:59 News : Newsletter #311Jayenkai Thu 17:27 Link : Super Shapes Exploration KitAndy_A Thu 11:09 Dev-Diary : Sensitive - Arduboy!rychan Thu 17:27 Snippet : Skylinessteve_ancell Tue 14:25More

Who's Online
Jayenkai
Sat, at 01:56
therevillsgames
Sat, at 00:49
Kuron
Fri, at 23:09
Evil Roy Ferguson
Fri, at 20:47
rskgames
Fri, at 19:28