getdate help
#6

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; 
}
Reply


Messages In This Thread
getdate help - by DetoNater - 24.12.2015, 20:43
Re: getdate help - by sheeraz - 25.12.2015, 06:46
Re: getdate help - by DetoNater - 25.12.2015, 06:49
Re: getdate help - by Vince - 25.12.2015, 11:12
Re: getdate help - by Tamy - 25.12.2015, 14:22
Re: getdate help - by ball - 25.12.2015, 14:44
Re: getdate help - by DetoNater - 25.12.2015, 17:11
Re: getdate help - by CrazyChoco - 25.12.2015, 17:30
Re: getdate help - by DetoNater - 25.12.2015, 17:34
Re: getdate help - by Vince - 25.12.2015, 22:20

Forum Jump:


Users browsing this thread: 2 Guest(s)