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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / formatDateTime() funct...
Power Automate
Answered

formatDateTime() function not working with dynamic content

(0) ShareShare
ReportReport
Posted on by 9

When I use the Start Date and End Date dynamic content normally, the flow works correctly, but I get an output with a full timestamp that looks ugly.

 

So I tried to use the formatDateTime() function to clean it up. 

 

Unfortunately, when I try to call the start and end date dynamic content in the middle of a function, those items do not appear for me, the only items that appear are "body" and "value", which I don't want.

 

Is this a bug? And is there a workaround?

 

Thanks!

 

Screenshot of full workflow up to the point where I have an issue:

dt235293_0-1657912880575.png

Screenshot of using dynamic content in the "Start" field in the Create HTML Table section.

dt235293_2-1657913030184.png

 

Screenshot of the dynamic content field after I create an expression. Notice that my options shrink:

dt235293_1-1657913010946.png

 

 

Categories:
I have the same question (0)
  • Verified answer
    dt235293 Profile Picture
    9 on at

    Of course, i found an immediate workaround once I posted this:

    convertTimeZone(item()?['Start'],'UTC','Central Standard Time','g') will provide the user with this date notation: 

    7/19/2022 7:00 AM

     

  • sabrina45322 Profile Picture
    10 on at
    for today
     
    formatDateTime(utcNow(),'MM-dd-yyyy')
     
    lowercase M is minutes, big M is months. you can change around what is in the single quotes.
     
    for other days
    formatDateTime(addDays(utcNow(),-1),'MM-dd-yyyy')
     
    -1 = yesterday, etc.
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @dt235293,

    Glad that you have resolved your problem.

    Could you please mark your reply as an answer to help more users?

    Thanks for your cooperation.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard