JapaneseLunisolarCalendarを使って計算すると便利です
static int RokuyoDate(DateTime clacDay)
{
JapaneseLunisolarCalendar jpnOldDays = new JapaneseLunisolarCalendar();
int oldMonth = jpnOldDays.GetMonth(clacDay); //旧暦の月を取得
int oldDay = jpnOldDays.GetDayOfMonth(clacDay);//旧暦の日を取得
var aaa = jpnOldDays.GetYear(clacDay);
var bbb = jpnOldDays.GetEra(clacDay);
//閏月を取得
int uruMonth = jpnOldDays.GetLeapMonth(
jpnOldDays.GetYear(clacDay),
jpnOldDays.GetEra(clacDay));
//閏月含む場合の月を補正
if ((uruMonth > 0) && (oldMonth - uruMonth >= 0))
{
oldMonth = oldMonth - 1; //旧暦月の補正
}
//ルールとしては
// (月 + 日) % 6 の結果が六曜になり
//大安→赤口→先勝→友引→先負→仏滅
int rokuyo = (oldMonth + oldDay) % 6;
return rokuyo;
}