Day/Month.
#5

Fortunately, I found this after searching:

pawn Код:
// Credit to yom
stock GetWeekDay(day=0, month=0, year=0) {
    if(!day)
        getdate(year, month, day);

    new
        szWeekDay[10],
        j,
        e;

    if(month <= 2) {
        month += 12;
        --year;
    }
   
    j = year % 100;
    e = year / 100;

    switch((day + (month+1)*26/10 + j + j/4 + e/4 - 2*e) % 7) {
        case 0: szWeekDay = "Saturday";
        case 1: szWeekDay = " Sunday";
        case 2: szWeekDay = " Monday";
        case 3: szWeekDay = " Tuesday";
        case 4: szWeekDay = "Wednesday";
        case 5: szWeekDay = "Thursday";
        case 6: szWeekDay = " Friday";
    }

    return szWeekDay;
}
It seemed to work when I tested (though the test script will return the day for 2 days ago as I subtracted 2 from the day count after getdate()) it.
Reply


Messages In This Thread
Day/Month. - by iGetty - 30.05.2012, 11:01
Re: Day/Month. - by Vince - 30.05.2012, 11:05
Re: Day/Month. - by iGetty - 30.05.2012, 11:09
Re: Day/Month. - by iGetty - 30.05.2012, 11:33
Re: Day/Month. - by Calgon - 30.05.2012, 11:49
Re: Day/Month. - by iGetty - 30.05.2012, 12:03

Forum Jump:


Users browsing this thread: 1 Guest(s)