# Fun with Dates

**URL:** <https://community.glideapps.com/t/fun-with-dates/21684>\
**Category:** Project Showcase\
**Created:** [January 24, 2021, 8:25pm UTC](https://community.glideapps.com/t/fun-with-dates/21684 "2021-01-24T20:25:08Z")\
**Posts on this page:** 1\
**Showing post:** 147

<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:** [August 27, 2021, 6:48am UTC](https://community.glideapps.com/t/fun-with-dates/21684/147 "2021-08-27T06:48:10Z")

</div>

@Jeff_Hager or @ThinhDinh - having a mental block here…

I’m using the following to get midnight on the first day of the current month:

```auto
N+1-DAY(N)-HOUR(N)/24-MINUTE(N)/1440-SECOND(N)/86400

```

Which works fine, but what I need now is:

- Midnight on the first day of last month
- Midnight on the first day of 2 months ago
- Midnight on the first day of 3 months ago

Example: today is 27th August, I want 3 math columns that will return midnight on the 1st of May, June & July respectively. I’m thinking that the [magic number 15](https://community.glideapps.com/t/find-the-last-day-of-the-following-month/21557/7) needs to come into play here, but struggling with it…

Help? 🙏

(I know I could do this easily enough with a bit of YC, but prefer not to resort to that unless there is no other option)

---

_[View the full topic](https://community.glideapps.com/t/fun-with-dates/21684)._
