i am trying to find when the first day of the week is for a given year and month. this formula gives the day of the first day of the year:(adsbygoogle = window.adsbygoogle || []).push({});

(([y-1]*365+[y-1]/4-[y-1]/100+[y-1]/400)+1)%7

if it equals 0, it starts on sunday. 1 means monday, 2 means tuesday, and so on ending with 6 for saturday. the problem is i am trying to figure out how this formula can help me find the beginning of all the months, not just january. any help would be appreciated.

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Finding the day of the week

**Physics Forums | Science Articles, Homework Help, Discussion**