Hello all,
I am building a workflow where I need to add/remove x-number of days to either the beginning or end of current, previous and next month. I have this part nailed down and working as expected. The date calculations are based on 3 initial values using these calculations:
CurrentMonth = (expecting May)
startOfMonth(utcNow())
PreviousMonth = Expecting April --> Actual is March
subtractFromTime(outputs('CurrentMonth'),1,'Month')
NextMonth = (expecting June)
startOfMonth(addToTime(utcNow(),1,'Month'))
This all worked as expected a few days ago, but now when I test on 1st May. The value for PreviousMonth is returning March 31st. My best guess is that by subtracting 1 Month, it is actually subtracting 31 days?
I could work around this by subtracting 4-weeks rather than 1-month but I'd like to know if I am missing anything here or if someone has seen a similar issue?
Thanks,
Scott
Solved! Go to Solution.
Hi @scottgm ,
I have made some tests on my side.
It has the same issue as yours.
As you said, the cause is subtracting 1 Month, it is actually subtracting 31 days.
I suggest you subtract 4-weeks here, or use the getPastTime function for a try.
Best Regards,
Community Support Team _ Zhongys
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @scottgm ,
I have made some tests on my side.
It has the same issue as yours.
As you said, the cause is subtracting 1 Month, it is actually subtracting 31 days.
I suggest you subtract 4-weeks here, or use the getPastTime function for a try.
Best Regards,
Community Support Team _ Zhongys
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
66 | |
23 | |
16 | |
16 | |
13 |
User | Count |
---|---|
116 | |
35 | |
32 | |
28 | |
26 |