年月日からその日が何曜日であったか求めます。
ここで使うのはツェラーの公式。
LSLは文字列比較は処理が重いらしいとどこかで見たので、
返却値をif文にかけるのであれば、integerのまま返却するようにすると良いと思います。
// 曜日取得
string GetWeek(integer year,integer month, integer day)
{
list weektbl = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
// 1月の場合は前年の13月,2月の場合は前年の14月
if ((month == 1) || (month == 2)) {
year--;
month += 12;
}
integer week =
(year + year / 4 - year / 100 + year / 400 + (month * 13 + 8) / 5 + day) % 7;
return llList2String(weektbl, week);
}
参考:giru0116のブログ