25.12.2015, 14:44
There is function for this, I have absolutely no idea how it works
Код:
GetWeekDay(day=0, month=0, year=0) { if(!day) getdate(year, month, day); new 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: return 6; //Saturday case 1: return 7; //Sunday case 2: return 1; //Monday case 3: return 2; //Tuesday case 4: return 3; //Wednesday case 5: return 4; //Thursday case 6: return 5; //Friday } return -1; }