web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Adding date and time f...
Power Automate
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

Categories:
I have the same question (0)
  • PrasadAthalye Profile Picture
    on at

    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'), ':'''), '.''')
  • Bill51106 Profile Picture
    152 on at

    @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 "

  • Bill51106 Profile Picture
    152 on at

    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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard