Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Adding date and time fails the flow

(0) ShareShare
ReportReport
Posted on by 152

Before the Flow worked great. The file name would always stay the same and I wanted to add a time stamp. I added this function

"formatDateTime(utcnow(),'Pacific Standard Time''MM-dd-yyyy hh:mm tt')" and now the flow fails, I also added .xlsx to the end thinking that was the problem. This function works on my other flows, what am I missing?

Capture.PNG

  • Bill51106 Profile Picture
    152 on at
    Re: Adding date and time fails the flow

    I figured out what the problem was, my previous file creations needed me to build the file name and I could add in functions and finish it off with .xls.

     

    This flow is different I see, it creates the entire file name. I got around this by placing this function prior "convertTimeZone(utcnow(),'UTC','Pacific Standard Time','MM-dd-yyyy hh:mm tt')"

    Capture.PNG

  • Bill51106 Profile Picture
    152 on at
    Re: Adding date and time fails the flow

    @PrasadAthalye First, thank you for responding. Previously my function worked to timestamp files and produced "filename 04-04-2021 11_30 PM.xls" now it fails, with your code it produces "filename.xlsx2021-04-0409321199445922 "

  • PrasadAthalye Profile Picture
    on at
    Re: Adding date and time fails the flow

    I think the format DateTime function returns time with a colon in it which can not be used in filenames. It's a special character. I put together the following expression. Can you try it?

     

    replace(replace(convertFromUtc(utcNow(), 'Pacific Standard Time'), ':'''), '.''')

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1