Get the day of the week
#3

pawn Code:
stock GetWeek(d,m,y) //by drakins,thanks vine
{
    m=(m-=2);
    if(m<=0) --y,m+=12;
    return ( ((
        (d+((13*m-1)/5)+(y%100)+((y%100)/4)+(((y%100)%100)/4)-2*(y%100))%7) == 0)?
        (((d+((13*m-1)/5)+(y%100)+((y%100)/4)+(((y%100)%100)/4
        )-2*(y%100))%7) + 1) : (((d+((13*m-1)/5)+(y%100)+((y%100)/4)+
        (((y%100)%100)/4)-2*(y%100))%7)
    ) );
}
Quote:

#define GetWeek() ((getdate() % 0x7) + 0x6)

Reply


Messages In This Thread
Get the day of the week - by MP2 - 19.09.2011, 23:31
Re: Get the day of the week - by dowster - 20.09.2011, 01:38
Re: Get the day of the week - by SourceCode - 20.09.2011, 01:44
Re: Get the day of the week - by Emmet_ - 20.09.2011, 01:44
Re: Get the day of the week - by SourceCode - 20.09.2011, 01:48
Re: Get the day of the week - by Emmet_ - 20.09.2011, 01:48

Forum Jump:


Users browsing this thread: 1 Guest(s)