I have a value startOfMonth(addToTime(utcNow(), -1, 'Month')) in Create File action in Microsoft flow. It gets the first date of the month and names the file as 2020-01-01T00_00_00.0000000Z.html.

However, I want it to just give the date as 01/01/2020 which doesn't include the rest of the digits.

Thank you.

  • 1
    Try using formatDateTime(startOfMonth(addToTime(utcNow(), -1, 'Month')),'dd/MM/yyyy') and let me know if this works for you. – Ganesh Sanap Feb 24 at 10:58
  • Hi Ganesh. It worked. Thank you. Can you answer this. So that I can mark this as answered? – Noman Feb 24 at 11:03
  • 1
    Great. added as an answer below. please upvote and mark as answered. – Ganesh Sanap Feb 24 at 11:06

Try using this formula:

formatDateTime(startOfMonth(addToTime(utcNow(), -1, 'Month')),'dd/MM/yyyy')
  • Done Ganesh. Just wondering If I can add months name for example January's report instead of this. Is it possible? I mean it gets the name of each month exactly as the same but in the output ( File name) will be like January Monthly report? – Noman Feb 24 at 11:09
  • 1
    That will need some more calculations,. Check this. it covers what you are seeking. – Ganesh Sanap Feb 24 at 11:12
  • 1
    Ok cheers my friend. Appreciate it. – Noman Feb 24 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.