This will change a date mm/dd/yy to the day of the week.
CODE
integer dayofweek;
integer m=9; //Jokey Domela's Birthday!
integer d=15;
integer y=6;
integer z;
list days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
mathit()
{
if (m < 3)
{
z = y - 1;
}
else
{
z = y;
}
dayofweek = ( llFloor(23 * m/9) + d + 4 + y + llFloor(z/4) - llFloor(z/100) + llFloor(z/400))%7;
if (m >= 3)
{
dayofweek = dayofweek - 2;
}
}
default
{
state_entry()
{
mathit();
string day = llList2String(days, dayofweek);
llSay(0,(string)day);
}
}