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

Community site session details

Session Id : CR6JWNNAQk51/HR2QKJwXl
Power Apps - Building Power Apps
Answered

Time Date format returned from Flow

Like (0) ShareShare
ReportReport
Posted on 28 Oct 2019 15:18:33 by 514

Hi all,

 

I have an app that is connected to a SQL DB. OnSelect of a button I have a Flow that executes a stored procedure and returns the information to PowerApps. In the response part of the Flow there is a TimeDate2 (2) column from SQL being returned as a string in JSON, this gives the response in the following format: "YYYY-MM-DDTHH:MM:SS.ss". I have tried using "Text(ThisItem.TSP_MsgTime, DateTimeFormat.ShortDateTime)" in PowerApps to format the date, but it is still showing as in the Flow response. Any ideas how I can get it to format properly? I would like it in the format DD/MM/YYYY HH:MM:SS, without the T in the middle and the final milliseconds. 

 

Thank in advance. 

  • mdevaney Profile Picture
    29,987 Moderator on 29 Oct 2019 at 12:34:14
    Re: Time Date format returned from Flow

    @HFG 

    Awesome.  Make sure to close the thread if your issue is solved 😸

  • HFG Profile Picture
    514 on 29 Oct 2019 at 12:18:23
    Re: Time Date format returned from Flow

    Haha, yes, that's crazy! 

     

    Thanks

  • Verified answer
    mdevaney Profile Picture
    29,987 Moderator on 28 Oct 2019 at 16:25:08
    Re: Time Date format returned from Flow

    @HFG 

    Yes, you can definitely convert into a datetime and then apply a TEXT function.

     

    With(
     {FlowYear:Value(Left(Label1.Text,4)),
     FlowMonth:Value(Right(Left(Label1.Text,7),2)),
     FlowDay:Value(Right(Left(Label1.Text,10),2)),
     FlowHours:Value(Right(Left(Label1.Text,13),2)),
     FlowMin:Value(Right(Left(Label1.Text,16),2)),
     FlowSec:Value(Right(Left(Label1.Text,19),2))
     },
     Text(
    DateAdd(
    DateAdd(
    DateAdd(
    Date(FlowYear,FlowMonth,FlowDay),FlowHours,Hours),
    FlowMin,Minutes),
    FlowSec,Seconds),
    "dd/mm/yyyy hh:mm:ss"
    ) )

     

    Crazy, right?

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • HFG Profile Picture
    514 on 28 Oct 2019 at 16:01:44
    Re: Time Date format returned from Flow

    Hi, 

     

    Thank you. 

     

    So you think there is no way that PowerApps can recognise it as a datetime in order to make use of all the different formats available? 

     

     

  • mdevaney Profile Picture
    29,987 Moderator on 28 Oct 2019 at 15:50:27
    Re: Time Date format returned from Flow

    @HFG 

    Here's my suggestion

     

    With(
     {FlowDT:Label1.Text},
     Right(Left(FlowDT,10),2)&"/"&
     Right(Left(FlowDT,7),2)&"/"&
     Left(FlowDT,4)&" "&
     Right(Left(FlowDT,13),2)&":"&
     Right(Left(FlowDT,16),2)&":"&
     Right(Left(FlowDT,19),2)
    )

     

    It will convert this text

     

    2019-10-28T15:14:54.15

     

    Into this text

     

    28/10/2019 15:14:54

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • HFG Profile Picture
    514 on 28 Oct 2019 at 15:34:10
    Re: Time Date format returned from Flow

    Hi @mdevaney

     

    Here is an example: 

    2019-10-28T15:14:54.15
    I have also attached a screenshot of the JSON response. 
     
    Thanks in advance for any help.
     
    (In the meantime, I am going to try to remove the parts of the string I don't need using functions.)
  • mdevaney Profile Picture
    29,987 Moderator on 28 Oct 2019 at 15:29:32
    Re: Time Date format returned from Flow

    @HFG 

    Can you please provide a specific example of a date/time returned by flow for the forum members to test when trying the conversion?

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete