# Given a month, year - how to calculate day #s

**URL:** https://forum.kirupa.com/t/given-a-month-year-how-to-calculate-day-s/296781
**Category:** flash
**Created:** [September 20, 2009, 1:23pm UTC](https://forum.kirupa.com/t/given-a-month-year-how-to-calculate-day-s/296781 "2009-09-20T13:23:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nburlington](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nburlington/32/1365_2.png) [@nburlington](https://forum.kirupa.com/u/nburlington)
#### Post date: [September 20, 2009, 1:23pm UTC](https://forum.kirupa.com/t/given-a-month-year-how-to-calculate-day-s/296781/1 "2009-09-20T13:23:19Z")

</div>

If I’m given a month and a year, how can I calculate what day of the week that month started on?

My end goal is to write a method that takes a month and a year and returns an array of dates for each Sunday in that month (ex: 7,14,21,28).
