[Include] Days [BETA]
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
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.
Glad you gave me those links, took me a while but I finally converted them!

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;
}
Updating the post now.
Reply


Messages In This Thread
Days [BETA] - by CreativityLacker - 15.05.2013, 08:35
Re: Days [BETA] - by CreativityLacker - 15.05.2013, 09:32
Re: Days [BETA] - by CreativityLacker - 15.05.2013, 11:55
Re: Days [BETA] - by Dzines4SAMP - 15.05.2013, 12:07
Re: Days [BETA] - by CreativityLacker - 15.05.2013, 13:31
Re: Days [BETA] - by steki. - 15.05.2013, 13:41
Re: Days [BETA] - by Badarau - 22.05.2013, 17:28
Re: Days [BETA] - by CreativityLacker - 22.05.2013, 18:16
Re: Days [BETA] - by Badarau - 23.05.2013, 07:55
Re: Days [BETA] - by Kiweeh - 23.05.2013, 13:09
Re: Days [BETA] - by Dragony92 - 26.05.2013, 13:19
Re: Days [BETA] - by CreativityLacker - 26.05.2013, 16:57
Re: Days [BETA] - by Dragony92 - 26.05.2013, 20:51

Forum Jump:


Users browsing this thread: 2 Guest(s)