/// <summary>
/// 计算当期日期是星期几
/// </summary>
/// <param name="y"></param>
/// <param name="m"></param>
/// <param name="d"></param>
/// <returns></returns>
private string CaculateWeekDay(int y, int m, int d)
{
//一月和二月被当作前一年的
if ((m == 1) || (m == 2))
{
m += 12;
y--;
}
int week = (d + 2 * m + 3 * (m + 1) / 5 + y + y / 4 - y / 100 + y / 400) % 7;
string weekstr = "";
switch (week)
{
case 0: weekstr = "Monday"; break;
case 1: weekstr = "Tuesday"; break;
case 2: weekstr = "Wednesday"; break;
case 3: weekstr = "Thursday"; break;
case 4: weekstr = "Friday"; break;
case 5: weekstr = "Saturday"; break;
case 6: weekstr = "Sunday"; break;
}
return weekstr;
}
}