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 / Using Compose with for...
Power Automate
Answered

Using Compose with formatDateTime & utcNow

(0) ShareShare
ReportReport
Posted on by 351
I am using a Compose action to take a dynamic content date value (from a SP list):

 Power_Automater_1-1659938263814.png

 

And then I use this in a Create/Update Event action to set the start date with:

formatDateTime(outputs(
'Compose'),'yyyy-MM-ddTHH:mm:ss'

Power_Automater_2-1659938346440.png

 

The problem is that the date and time I get in the Compose action is the incorrect timezone so by the time it is added into the event action it is wrong. Should I change what I put into the Compose action or update the expression used for start time, and if so how?

Categories:
I have the same question (0)
  • Rhiassuring Profile Picture
    8,692 Moderator on at

    Hi there, 

     

    You can use the "convertTimeZone()" action in your compose, on your dynamic content. You might have something like convertTimeZone(yourfield,'UTC','Pacific Standard Time'). That should take care of it!

  • Power_Automater Profile Picture
    351 on at

    Thank you for that @Rhiassuring , so if I were to add the compose to this it would look like this?

    convertTimeZone(outputs('Compose'),'UTC','Pacific Standard Time')

    Also, where would I put the date format string part?

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    You'd put it on the outside of that - like this: 

     

    formatdatetime(convertTimeZone(utcNow(),'UTC','Pacific Standard Time'),'yyyy-MM-dd')

    (In my example I'm using utcNow() instad of a field, just to be clear)
  • Power_Automater Profile Picture
    351 on at

    So with the compose it would be like this?

    formatdatetime(convertTimeZone(outputs('Compose'),'UTC','Pacific Standard Time'),'yyyy-MM-dd')

  • Verified answer
    Rhiassuring Profile Picture
    8,692 Moderator on at

    You don't need to point at your Compose, you can call out your field. If you're going to use a field that will only have one output (like a single form response), it will look like this:

     

    formatdatetime(convertTimeZone(outputs('Get_items')?['body/value'][0]?['Created'],'UTC','Pacific Standard Time'),'yyyy-MM-dd')
     
    The [0] lets you get the only item in the array that is returned, since it's a single item. No need to go into an Apply to Each. And the ['Created'] is where you type whatever column you want.
     
    If you are doing it in an Apply To Each (when there are multiple returns), it will look like this, inside of the Apply to Each:

    formatdatetime(convertTimeZone(items('Apply_to_each')?['Created'],'UTC','Pacific Standard Time'),'yyyy-MM-dd')
     
    Rhiassuring_0-1660183169198.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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 476

#2
Haque Profile Picture

Haque 424

#3
David_MA Profile Picture

David_MA 350 Super User 2026 Season 1

Last 30 days Overall leaderboard