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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Expression: Add Hours ...
Power Automate
Unanswered

Expression: Add Hours within a FormatDateTime expression

(0) ShareShare
ReportReport
Posted on by 243

Hi all,

 

Needing some advice regarding an expression for a date field. 

 

An expression used in a flow to populate an invoice date field (field a), with a date from another record (field b) is populating the day prior to what is expected for 'field b'.  I believe it is one day prior, as our time zone is 10 hours ahead of the UTC time zone - so when populating 'now' I would generally write as ... ... ...  addhours(utcNow(), 10) .  This makes me think that the 'field a' & 'field b' situations means that I need to apply this addhours function to the expression that I'm writing.

The expression I've used which is populating the 'field a' is:

formatDateTime(body('Get_Field_b_Date_for_Invoice')?['ec_date'], 'yyyy-MM-dd')

 

When I tried to add the 10 hours in there, I keep getting an Invalid Expression.  Updated invalid expression:

formatDateTime(addhours(body('Get_Field_b_Date_for_Invoice')?['ec_date'], '10')'yyyy-MM-dd')

 

Any feedback is appreciated.

T.

Categories:
I have the same question (0)
  • CFernandes Profile Picture
    8,482 Most Valuable Professional on at

    @Tarjani Let me try to simple for you.

     

    If you are not comfortable with expression, the just use the 'Add to Time', see screenshot below.

     

    CFernandes_0-1600159282803.png 

     

    You also the Function ference at https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#addtotime 

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

  • Tarjani Profile Picture
    243 on at

    @CFernandes ,

    I appreciate your feedback, but I think you are simplifying the wrong expression - or I am missing what you are trying to say.  

     

    I'm fine with doing an addhours expression.  However I"m trying to insert this expression, inside another expression.  The expression that I'm trying to put it into is the one that I need to work with.  If possible, I'd like to do it with an expression as the expression that I listed in my original post is being used within a variable.

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!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 173 Super User 2026 Season 1

#3
Kalathiya Profile Picture

Kalathiya 95 Super User 2026 Season 1

Last 30 days Overall leaderboard