# Get the days of the current month

**URL:** <https://community.glideapps.com/t/get-the-days-of-the-current-month/76959>\
**Category:** Ask for Help\
**Created:** [October 9, 2024, 4:36pm UTC](https://community.glideapps.com/t/get-the-days-of-the-current-month/76959 "2024-10-09T16:36:29Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![CARLOS1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/carlos1/32/86364_2.png) [@CARLOS1](https://community.glideapps.com/u/CARLOS1)\
**Post date:** [October 9, 2024, 4:36pm UTC](https://community.glideapps.com/t/get-the-days-of-the-current-month/76959/1 "2024-10-09T16:36:29Z")

</div>

Hello, how do you find them? One question, is it possible to get the days of a month? For example, I would like to obtain a formula perhaps where I can obtain how many days the current month has, for example if we are in October and this month has 31 days, then I want to return 31, something that is based on the current date.

---

<div class="post-metadata">

**Author:** ![micheal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/micheal/32/80181_2.png) [@micheal](https://community.glideapps.com/u/micheal)\
**Post date:** [October 9, 2024, 5:22pm UTC](https://community.glideapps.com/t/get-the-days-of-the-current-month/76959/2 "2024-10-09T17:22:28Z")

</div>

Use this in a math column:

`DAY((Date - DAY(Date) + 32) - DAY(Date - DAY(Date) + 32))`

where Date is now or your date.

Took me a while to get this and had to use the other examples in the community as a guide and also ChatGPT to assist 😉

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [October 10, 2024, 8:28am UTC](https://community.glideapps.com/t/get-the-days-of-the-current-month/76959/3 "2024-10-10T08:28:52Z")

</div>

32 seems safe enough, but 45 would be yet safer to stay away from the edges of the month.

Here you’ll find a bunch of useful formulas:

> [@date Guide: Mastering Dates & Times](https://community.glideapps.com/t/guide-mastering-dates-times/70381):
>
> The Date & Time column contains both a date and time value within one single value. Dates and times can therefore be tricky to understand and to work with. It helps to keep things simple to stay out of trouble. Here are a few tips: Writing dates Avoid writing dates manually. Use a picker instead. If done via import, be weary of the format of the date column in the source. Relations Anytime you create a relation with a date, convert the date to either a string (template column) or a number (…

---

<div class="post-metadata">

**Author:** ![micheal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/micheal/32/80181_2.png) [@micheal](https://community.glideapps.com/u/micheal)\
**Post date:** [October 10, 2024, 8:59am UTC](https://community.glideapps.com/t/get-the-days-of-the-current-month/76959/4 "2024-10-10T08:59:46Z")

</div>

oh that also works perfectly - is there a reason why 45 works so well? cause in the solutions in the community I mostly see 45

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [October 10, 2024, 9:18am UTC](https://community.glideapps.com/t/get-the-days-of-the-current-month/76959/5 "2024-10-10T09:18:26Z")

</div>

It’s just an arbitrary number that is guaranteed to always land somewhere in the middle of the next month, regardless of how many days in the month.

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [October 10, 2024, 10:49am UTC](https://community.glideapps.com/t/get-the-days-of-the-current-month/76959/6 "2024-10-10T10:49:00Z")

</div>

If you’re on the 1st of the month, +32 will bring to the beginning of the following month. Really I think +31 would work too. If you want to land far from the beginning or the end of the month, you need to add two weeks. So as Darren said, +45 is totally arbitrary, but it’s safe to keep you away from the edges.

---

<div class="post-metadata">

**Author:** ![micheal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/micheal/32/80181_2.png) [@micheal](https://community.glideapps.com/u/micheal)\
**Post date:** [October 10, 2024, 10:58am UTC](https://community.glideapps.com/t/get-the-days-of-the-current-month/76959/7 "2024-10-10T10:58:52Z")

</div>

I see alright, while 32 works, 45 is best. Also, I tried with 31 but it didn’t get it right for October.  
Thank you both.

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [October 10, 2024, 11:00am UTC](https://community.glideapps.com/t/get-the-days-of-the-current-month/76959/8 "2024-10-10T11:00:40Z")

</div>

Anything between 32 and 56 (or so) should work. 45 happens to be smack in the middle (or just about).

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [October 10, 2024, 2:59pm UTC](https://community.glideapps.com/t/get-the-days-of-the-current-month/76959/9 "2024-10-10T14:59:00Z")

</div>

45 simply works because it’s the number our own @Jeff_Hager has chosen.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [October 10, 2024, 3:12pm UTC](https://community.glideapps.com/t/get-the-days-of-the-current-month/76959/10 "2024-10-10T15:12:57Z")

</div>

“Middle of the month” using something like 15 or 45 has more of a purpose when trying to add several months or years to a date. Since each month has a different number of days, the resulting date can sometimes float around, so aiming for the middle of the month allows for some wiggle room when doing the math. In this particular case, 32 works just fine since the goal is just to get to the last day of the current month and 32 puts you safety into the next month.

---

<div class="post-metadata">

**Author:** ![CARLOS1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/carlos1/32/86364_2.png) [@CARLOS1](https://community.glideapps.com/u/CARLOS1)\
**Post date:** [October 10, 2024, 3:26pm UTC](https://community.glideapps.com/t/get-the-days-of-the-current-month/76959/12 "2024-10-10T15:26:31Z")

</div>

I have been reading your comments, and I thank all the Glide experts who help me learn new logics that I had not implemented. Every day I continue learning about Glide in conjunction with your comments in different posts.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [October 17, 2024, 3:26pm UTC](https://community.glideapps.com/t/get-the-days-of-the-current-month/76959/13 "2024-10-17T15:26:40Z")

</div>

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