Are you working on the formatDateTime() function in Power Automate? I will explain how to get start and end of the month in Power Automate. Also, I have taken four examples based on the previous month.
- Power Automate returning the first day of the current month
- How to get the last day of the current month in Power Automate
- Power Automate returning the first day of the next month
- Power Automate returning on the last day of the next month
Here, we wanted to get the first day and last day of the current month along with the start day and end day of the next month using Power Automate flow.
Get Start Day of Current Month in Power Automate
Here, I will explain how to get the start day of the current month by using a Power Automate flow based on the utcNow() function, which retrieves the current date and time values inside a flow.
Let’s create a Power Automate flow that will trigger manually. Follow the below steps:
1. Click on App Launcher -> Select Power Automate. On the Homepage, Click on +Create and select “Instant cloud flow”. In the next window, set the flow name, choose “Manually trigger a flow” and click on Create.
2. Next, add an “Initialized variable” to store the value and be used during the flow. Here, provide the details below:
- Name: Set a name for an initialized variable.
- Type: Select datatype as ‘String‘ from the drop-down.
- Value: Add the below code in value.
startOfMonth(utcNow(),'dd-MM-yyyy')

3. Then, add a Compose data operation to check the output from an initialized variable.
- Inputs: Select output from variables under dynamic content.
@{variables('First Day of Month')}

4. Now, the flow is ready, and we can test it. Save the flow and Click on Test -> Manually to test flow.

5. This is the output received from the compose flow action i.e., start day of the current month (01-10-2023).

This is how to get the start day of the current month using Power Automate flow.
Get End Day of Current Month in Power Automate
Now, by using the utcNow() function in a Power Automate flow, I will explain how to get an end day of the current month by using the current date (16-10-2023).
For that, follow the below steps that will guide you to create a flow:
1. Open a Power Automate Home page at https://make.powerautomate.com/. Then click on +Create -> Select “Instant cloud flow”. In the next window, provide a flow name, select “Manually trigger a flow”, and click on Create.
2. Next, in the flow studio, add an initialized variable and set the properties below:
- Name: Give a name for an initialized variable.
- Type: Select datatype as ‘String’ from drop-down.
- Value: Add the below-given expression in value.
subtractFromTime(startOfMonth(addToTime(utcNow(),1,'month')),1,'day','dddd, MMMM dd,yyyy')

3. Then, add a Compose flow action and provide the expression in the “Inputs” section.
@{variables('Last Day')}

4. Now, the flow is ready. Test the flow by saving it. Click on Save -> Click on Test.

5. The screenshot will show the output obtained from the compose action i.e., the Last day of the current month.

This is how to get the end day of a current month using a Power Automate flow.
Get Start Day of Next Month in Power Automate
In the same way, now, based on the current date (16-10-2023) and utcNow() function in Power Automate. Now, I will explain how to get the start day of the next month inside a flow.
In the expression, I will use the StartofMonth and addtoTime formula in a Power Automate flow to obtain the first day of next month in dd/MM/yyyy format.
Follow the above-mentioned similar steps to build a flow:
1. Provide Name, Type, and Value in an initialized variable. In the “Value” section, place the below code.
startOfMonth(addToTime(utcNow(),1,'Month'),'dd/MM/yyyy')

2. To check the output, add a “Compose” flow action and set the “Inputs” value as given in the below code.
@{variables('First day')}

3. The output received from a compose action will be given on the first day of the Next Month.

This is how to get the first day of the next month using a Power Automate flow.
Get End Day of Next Month in Power Automate
In this section, I will explain the final example i.e., how to get the last day of the next month using a Power Automate flow.
Let us get the last day of the next month inside a Power Automate flow. For that, I will use the utcNow() function, which retrieves the current date(16-10-2023).
Based on the current date, I will use StartofMonth and addtoTime formulas to show the output as the end day of next month.
Follow the same steps that are mentioned above to construct a flow:
1. In an “Initialized variable“, set the details below:
- Name: Set a name for a variable.
- Type: Select datatype as ‘String’ from drop-down.
- Value: Provide the below expression in value.
subtractFromTime(startOfMonth(addToTime(utcNow(),2,'month')),1,'day','dd-MMMM-yyyy')

2. Then, add a “Compose” action to display the output and set the below parameter.
- Inputs: Select from dynamic content under variables.
@{variables('Last day')}

3. The output generated from a compose flow action will show the last day of the next month.

This is how to extract the last day of next month using a Power Automate flow.
Conclusion
I hope this Power Automate tutorial helped you better understand the StartofMonth() and addtoTime() functions to get the start day and end day of a current month inside a flow. In addition to that, I have also demonstrated how to get a start day and end day of the next month using a Power Automate flow.
You may like the following tutorials:
- Get Current and Previous Month in Power Automate
- How to Get Current Year in Power Automate?
- Get Current Date in Power Automate

Preeti Sahu is an expert in Power Apps and has more than 6 years of experience working with SharePoint and the Power Platform. As a Power Platform expert for Power BI, Power Apps, Power Automate, Power Virtual Agents, and Power Pages, she is currently employed with TSinfo Technologies. She is the author of the book Microsoft Power Platform A Deep Dive. She also made a big technical contribution to SharePointDotNet.com in the form of articles on the Power Platform. She enjoys traveling and spending time with her family in her spare time.