How does Tomohiko Sakamoto's Algorithm work? need details explanation

Following function represents Sakamoto’s Algorithm from Wikipedia page- Determination of the day of the week - Wikipedia

int dow(int y, int m, int d) {
/* 1 <= m <= 12,  y > 1752 (in the U.K.) */
static int t[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
y -= m < 3;  
return (y + y/4 - y/100 + y/400 + t[m-1] + d) % 7;

}

i do not understand how does the algorithm work? especially, the t[] array.

Hi @nahid_alam,

I was going through the same algorithm, it is explained well here:

I hope it helps. :smiley: