# Go to start of month -\> last day of the month before

**URL:** <https://community.appfarm.io/t/go-to-start-of-month-last-day-of-the-month-before/391>\
**Category:** Ask the community\
**Created:** [April 3, 2023, 10:05am UTC](https://community.appfarm.io/t/go-to-start-of-month-last-day-of-the-month-before/391 "2023-04-03T10:05:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sondre](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/sondre/32/105_2.png) [@Sondre](https://community.appfarm.io/u/Sondre)\
**Post date:** [April 3, 2023, 10:05am UTC](https://community.appfarm.io/t/go-to-start-of-month-last-day-of-the-month-before/391/1 "2023-04-03T10:05:47Z")

</div>

Value processing to “start of month” for march gives 02.28.23-00.  
Value processing to “start of month” for april gives 03.31.22-00.

Is this intentional, a bug or a missing datetime setting in the environment I am in? 🙂

---

<div class="post-metadata">

**Author:** ![Olav](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/olav/32/63_2.png) [@Olav](https://community.appfarm.io/u/Olav)\
**Post date:** [April 3, 2023, 10:16am UTC](https://community.appfarm.io/t/go-to-start-of-month-last-day-of-the-month-before/391/2 "2023-04-03T10:16:06Z")

</div>

Hi!

I think this is simply due to switching to daylight saving time! The datetimes are given in GMT, so until March 26 we were one hour ahead of GMT, but now we are two hours ahead.

So given that your timezone is set to Norway, 02.28.23-00 would return 03.01.00-00 in local time, and 03.31.22-00 would return 04.01.00-00 in local time.

---

<div class="post-metadata">

**Author:** ![Sondre](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/sondre/32/105_2.png) [@Sondre](https://community.appfarm.io/u/Sondre)\
**Post date:** [April 3, 2023, 10:40am UTC](https://community.appfarm.io/t/go-to-start-of-month-last-day-of-the-month-before/391/3 "2023-04-03T10:40:07Z")

</div>

So it is intentional, in that case im kind of dependent on making this show local time as it is important for the service logic. The service timezone is set to europe/oslo.

Do you have a suggestion on how to make start of month set start of this month in the local time zone? 🙂

---

<div class="post-metadata">

**Author:** ![Olav](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/olav/32/63_2.png) [@Olav](https://community.appfarm.io/u/Olav)\
**Post date:** [April 3, 2023, 11:11am UTC](https://community.appfarm.io/t/go-to-start-of-month-last-day-of-the-month-before/391/4 "2023-04-03T11:11:10Z")

</div>

If you set a datetime to “start of month” it should return start of this month in the local time zone. All datetime objects in Appfarm are stored in UTC/GMT, but are converted automatically to correspond with the timezone set in the app or service in question. You can read more about date and time in our [Documentation](https://docs.appfarm.io/reference/platform-concepts/date-and-time).

Are the datetime objects not behaving according to the description in the Docs? If so, where are you performing the value processing and where is the datetime returned with an unexpected value?

---

<div class="post-metadata">

**Author:** ![Sondre](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/sondre/32/105_2.png) [@Sondre](https://community.appfarm.io/u/Sondre)\
**Post date:** [April 3, 2023, 11:35am UTC](https://community.appfarm.io/t/go-to-start-of-month-last-day-of-the-month-before/391/6 "2023-04-03T11:35:41Z")

</div>

It works like the documentation, (sorry for not checking). I guess that this is so standard that most other systems are expected to also run on UTC? Then this is not a problem at all 🙂

---

<div class="post-metadata">

**Author:** ![Olav](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/olav/32/63_2.png) [@Olav](https://community.appfarm.io/u/Olav)\
**Post date:** [April 4, 2023, 6:42am UTC](https://community.appfarm.io/t/go-to-start-of-month-last-day-of-the-month-before/391/7 "2023-04-04T06:42:15Z")

</div>

No worries! 😊

Shouldn’t be a problem, but of course depends on the setup of the other system.
