If you check this out, there is a C program that gives some clues about this.

One is to use 2 arrays, one for days in month, the other for month names. that makes it easier to look up the month name, without lots of if else clauses.

When I did this years ago, I remember there being a formula that calculated which day of the week it was given the day, month & year. It calculated the number of days since sometime in the 1700's (1752? a guess) , which was the last time that anyone meddled with the calendar. It wasn't a straight forward formula, our teachers gave it to us as part of the assignment.

I guess you could do the same thing, start from a date that you know which day it was, calc the number of days to the input date, use the % operator (modulus) to work out which day it is.