Discuss and collaborate on GML scripts

You are not logged in.

- Topics: Active | Unanswered

Pages: **1**

**blopit****Member**- Registered: 2009-05-19
- Posts: 7

```
/*
get_weekday(day,month,year)
arguments:
day
month
year
returns:
the weekday on the date indicated
0=sunday
1=monday
2=tuesday
*/
yy=argument2 mod 100
c=((argument2-(argument2 mod 100))/100)
m= argument1+10
if m>12 =false {yy-=1}else{m-=12}
return (floor(argument0+((13*m-1)/5))+yy+floor(yy/4)+floor(c/4)-(2*c))mod 7
```

made this while checking zeller's laws

Offline

**xot****Administrator**- Registered: 2007-08-18
- Posts: 1,240

Interesting but Game Maker already has this functionality.

`date_get_weekday(date_create_date(year,month,day));`

What are "zeller's laws"?

*Abusing forum power since 1986.*

Offline

**blopit****Member**- Registered: 2009-05-19
- Posts: 7

Woops I completely missed that one. I honestly don't even remember that command.

and for zeller's laws

http://en.wikipedia.org/wiki/Zeller's_congruence

the 'laws' are the rules you have to follow to find the correct weekday.

*Last edited by blopit (2009-05-20 18:03:32)*

Offline

Pages: **1**