Hi,
i have created a flow using power automate (with the assistance of eric-cheng), that will send an email to a user 30 days prior to a due date. The emails are working fine; subject line and content in body is good, however the date in the body is in the wrong format.
- Currently the format is MM-dd-yyyy and i would like to change it to dd-MM-yyy. Following is what i tried
- I changed the format at the 'Initalize variable' stage
from: addDays(utcNow(), variables('varNumDays'), 'MM-dd-yyyy')
To: addDays(utcNow(), variables('varNumDays'), 'dd-MM-yyyy'). when i did this the emails did not send.
- I then added a Compose to the the 'Apply to each'. Email worked but date in wrong format
Any help will be greatly appreciate
Thank you
Hi eric,
added new format date string and now the flow is coming up with an error 'String was not recognized as a valid DateTime. Creating query failed.'
Hi eric,
tried formatDateTime(addDays(utcNow(), variables('varNumDays')),'dd-MM-yyyy') however the date is still displayed as yyyy-mm-dd
Hi @Violet1 ,,
Try
formatDateTime(addDays(utcNow(), variables('varNumDays')),'dd-MM-yyyy')
--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up
Connect on LinkedIn
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2