# Extract the first day of the month

**URL:** <https://community.glideapps.com/t/extract-the-first-day-of-the-month/69991>\
**Category:** Ask for Help\
**Tags:** custom-code\
**Created:** [January 25, 2024, 5:12am UTC](https://community.glideapps.com/t/extract-the-first-day-of-the-month/69991 "2024-01-25T05:12:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ryan/32/15941_2.png) [@Ryan](https://community.glideapps.com/u/Ryan)\
**Post date:** [January 25, 2024, 5:12am UTC](https://community.glideapps.com/t/extract-the-first-day-of-the-month/69991/1 "2024-01-25T05:12:06Z")

</div>

Hi team,  
So I’m trying to extract the 1st day of the month, regardless of the user’s date format.

No matter what I try, it works only if the input format is MM/DD/YYYY.

e.g.  
Input data 31/12/2023 → I expect it to return 01/12/2023 OR 12/01/2023 (doesn’t work)  
Input data 12/31/2023 → does work and returns 12/01/2023.

Thanks!

---

<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:** [January 25, 2024, 5:24am UTC](https://community.glideapps.com/t/extract-the-first-day-of-the-month/69991/2 "2024-01-25T05:24:50Z")

</div>

As long as your source date is a date column, you can use a math column to get the first day of the month.

```auto
Date-Day(Date)+1

```

---

<div class="post-metadata">

**Author:** ![Ryan](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ryan/32/15941_2.png) [@Ryan](https://community.glideapps.com/u/Ryan)\
**Post date:** [January 25, 2024, 1:47pm UTC](https://community.glideapps.com/t/extract-the-first-day-of-the-month/69991/3 "2024-01-25T13:47:10Z")

</div>

Magic @Jeff_Hager !

For the record, to find the _last_ day of the month (also provided by the magician), use `((Now-DAY(Now)+15)+30)-DAY((Now-DAY(Now)+15)+30)`

---

<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:** [February 1, 2024, 1:47pm UTC](https://community.glideapps.com/t/extract-the-first-day-of-the-month/69991/4 "2024-02-01T13:47:15Z")

</div>

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