15.05.2013, 11:55
Quote:
I found these: http://www.wikihow.com/Calculate-the-Day-of-the-Week they're written for mental calculation, but I'm sure there are ways to port them to code. I also found this JavaScript, but again don't know how reliable it is:
http://www.sislands.com/coin70/week3/dayofwk.htm A cursory glance looks OK, and don't forget that PAWN already has integer division represented in that code by Math.floor. |
pawn Код:
stock GetDay(day, month, year)
{
if (month < 3)
{
month += 12;
year--;
}
return ((13*month+3)/5 + day + year + year/4 - year/100 + year/400) % 7;
}