Skip to main content

Notifications

Community site session details

Community site session details

Session Id : CurlhLL6IYXb9BPXVuLP4d
Power Automate - General Discussion
Answered

Formatting Date And time in MS Flow

Like (2) ShareShare
ReportReport
Posted on 20 Jul 2018 19:47:39 by

I am running into a problem when trying to get the date/time out of a column. I need it to display what is in the column and cant figure out how to format it in Flows. Attached is the issue and my flow. I need it to read the date/time in a mm/dd hh:mm AM/PM. any help will be greatly appreciated!

Flow 2.PNGFlow 1.PNG

Categories:
  • ayushch Profile Picture
    2 on 22 Mar 2022 at 13:59:50
    Re: Formatting Date And time in MS Flow

    formatDateTime( [your date here] , 'MM/dd/yyyy hh:mm:tt')

    formatDateTime( [your date here] , 'MMMM/dd/yyyy hh:mm:tt')

    formatDateTime( [your date here] , 'hh:mm tt') hour minute am/pm

  • Community Power Platform Member Profile Picture
    on 05 Aug 2021 at 12:25:55
    Re: Formatting Date And time in MS Flow

    @Anonymous , where are you having an issue?

     

    could you please provide a summary of the options you have tried?

     

    also, it may be more appropriate to start a new thread rather than using this one if your question is more than just about formatting date/time.

     

    thanks,

    Kyle

  • Community Power Platform Member Profile Picture
    on 05 Aug 2021 at 12:11:41
    Re: Formatting Date And time in MS Flow

    Dear All,

     

    i am trying to build a flow where 24hr before the flow should initiate email provided in excel.

     

    Vipul2021_0-1628165468736.png

     

    I have tried multiple options but not a success.....can you please guide me?

  • RickB Profile Picture
    3 on 15 Dec 2020 at 18:37:07
    Re: Formatting Date And time in MS Flow

    You saved me hours of research 🙂 I can't believe after all that thinking and searching I saw this lol. 

     

    I also needed my other output in yyyy-MM-dd format and it was not listed in the drop down values it provides so I just typed it in the format I needed under custom and voila! It worked. 

     

    Thanks again!

     

    time conversion.PNG

  • Mrmus Profile Picture
    11 on 19 Aug 2020 at 12:45:33
    Re: Formatting Date And time in MS Flow
    formatDateTime(utcNow(),'MM/dd/yyyy hh:mm tt')
  • Community Power Platform Member Profile Picture
    on 10 Jun 2020 at 20:20:50
    Re: Formatting Date And time in MS Flow

    @CarlHRVA I did solve it but it was by using an expression in a Compose component and then using that output in the email. Unfortunately using regular excel is not really an option for this case. I posted it in a separate post, and I elaborated on the answer there. @Anonymous and @ManishJain helped me get there and have some more info.

  • CarlHRVA Profile Picture
    601 on 10 Jun 2020 at 19:26:55
    Re: Formatting Date And time in MS Flow

    @Anonymous

    Are you using Excel Online? From what I understand Excel Online will return the date column as plain numbers rather than dates. Possible to use "regular" Excel instead?

  • Community Power Platform Member Profile Picture
    on 10 Jun 2020 at 19:22:46
    Re: Formatting Date And time in MS Flow

    @Anonymous 

     

    I would suggest creating a new topic with your specific issue, including everything you wrote here, and adding what output you are getting after each of your attempts:

     

    Are you getting errors in the flow or is it that the output is not what you want?

     

    Also, include screenshots of your flow (your addDays action block, for example).

     

    At first glance, I think I can say with certainty that formatDateTime() will not work here, as it requires the date being formatted be in a string format, so passing in the integer format from excel will not work with that expression.

     

    It might be your reference to your data. If you're pulling from an excel table, then you're probably inside of an "Apply to each" loop, in which case you should use the items() expression passing in the name of the loop rather than body() passing in the name of the "Get Rows" action block.

     

    Starting a new topic will give you a greater chance of receiving a response from someone who can help you in the forums, rather than responding to a topic that already has a solution.

     

    thanks,

    Kyle

  • Community Power Platform Member Profile Picture
    on 10 Jun 2020 at 18:10:11
    Re: Formatting Date And time in MS Flow

    This does not work for me. I have two dates in excel that I am trying to pull into an email using Power Automate. I have tried using the formatDateTime expression and the addDays expression and neither are working for me. 

     

    Currently if I try to just pull the date from the excel document and put it in the email it just returns a number like 44003 or something close to that.

     

    Here's some of the things I have tried:

     

    addDays("1899-12-30", int(body('Get_a_row_after_updates')?['When will the student licenses be installed?']), "d MMM yyyy")
     
    addDays("1899-12-30", variables('startDate'), "d MMM yyyy") - in this case I created a variable called startDate where I convert the string from excel into an integer, rather than convert it into an integer in the formula, because that was giving me an error. 
     

    formatDateTime(int(body('Get_a_row_after_updates')?['When will the student licenses be installed?']), "d MMM yyyy") - I've also tried this without the int. 

     

    Why will none of these work?! It's the last thing I need to do for this flow. It should not be this hard!

  • Community Power Platform Member Profile Picture
    on 24 Apr 2020 at 19:39:01
    Re: Formatting Date And time in MS Flow

    @ScottShearer, thank you! 

     

    I have been looking everywhere trying to figure out how to add AM/PM to the timestamp... 

     

    Those two little t's at the end did the trick! thank you! 

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,662 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard