# How do you calculate which day of the week any given date is?

**URL:** <https://community.thunkable.com/t/how-do-you-calculate-which-day-of-the-week-any-given-date-is/2782706>\
**Category:** Questions about Thunkable X\
**Tags:** calendars, dates\
**Created:** [January 14, 2024, 9:22pm UTC](https://community.thunkable.com/t/how-do-you-calculate-which-day-of-the-week-any-given-date-is/2782706 "2024-01-14T21:22:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![troop4apprgpj](https://avatars.discourse-cdn.com/v4/letter/t/f07891/32.png) [@troop4apprgpj](https://community.thunkable.com/u/troop4apprgpj)\
**Post date:** [January 14, 2024, 9:22pm UTC](https://community.thunkable.com/t/how-do-you-calculate-which-day-of-the-week-any-given-date-is/2782706/1 "2024-01-14T21:22:22Z")

</div>

I’m trying to make a calendar, but I can’t find a way to get what day starts a month, how would I do it?

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [January 14, 2024, 9:32pm UTC](https://community.thunkable.com/t/how-do-you-calculate-which-day-of-the-week-any-given-date-is/2782706/2 "2024-01-14T21:32:34Z")

</div>

looks like this. i opted for [zellers congruence](https://people.csail.mit.edu/ddeford/dotw.html) but there’s another method called [doomsday](http://rudy.ca/doomsday.html#:~:text=Doomsday%20is%20February%2028th%20or,February%20is%20Thursday%20the%2029th) BUT it seems far more convoluted IMO

 ![Screenshot 2024-01-14 at 4.29.28 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/0/00ba486d4650d3381be10895e5f58ce7c9f2ca08.png)

you can check it out in a custom component  
[https://x.thunkable.com/component/659eca71a49469080acbcb97/](https://x.thunkable.com/component/659eca71a49469080acbcb97/)

this algorithm is part of a calendar. first i find the day of the week for the first of the month. backfill the previous days, and generate the rest of the weeks for that month. then i return that array of arrays to the cloning section and generate the days/weeks in the visual UI

 ![Screenshot 2024-01-14 at 4.33.39 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/c/bca21304e40cb2c63097d04968cb68c38723fb96.png)  
 ![Screenshot 2024-01-14 at 4.35.28 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/e/cec2314853fa84471295c11f2e2fc5d4817afd06.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [April 13, 2024, 10:25pm UTC](https://community.thunkable.com/t/how-do-you-calculate-which-day-of-the-week-any-given-date-is/2782706/4 "2024-04-13T22:25:23Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
