直接写成一个函数了
int getTheWeek(int year, int month, int day) { int week = 0; int century = year / 100; year = year % 100; week = year + year / 4 + century / 4 - 2 * century + (26 * (month + 1))/ 10 + day - 1; week = week % 7; return week; }
原文地址:http://blog.csdn.net/u012566693/article/details/45484089