Skip to main content
Community site session details

Community site session details

Session Id : t0iV8GvKXPSkCVt7tc0yr5
Power Automate - Using Flows
Answered

Format Date Time to dd/mm/yyyy hh:mm

Like (0) ShareShare
ReportReport
Posted on 4 Apr 2022 17:18:03 by 54

Hi,

I am using MS Flow (Power Automate) using a Scheduled task - i.e. Recurrence, Execute stored procedure (V2), Create CSV Table and Send Email (V4). I have an issue formatting date/time. When I build my CSV table from a SQL Stored Procedure, the object 'ResultSets Arrived' appears as: 2022-04-01T10:29:19.14.  I want this appearing as 01/04/2022 10:29 (i.e. dd/mm/yyyy hh:mm).

In 'Create CSV Table' I tried to create a custom column for 'Arrived' using expression:

convertTimeZone([Arrived],'UTC','W. Europe Standard Time','dd/MM/yyyy HH:mm') but it failed.
Please help.
Thanks!
  • Verified answer
    Sach2022 Profile Picture
    54 on 07 Apr 2022 at 11:56:12
    Re: Format Date Time to dd/mm/yyyy hh:mm

    Solving this because I worked it out.  I need to use this function which closely resembles what was specified above and because i had NULL, I wrapped it with an If statement:  

    if(empty(item()?['Arrived']), '-', formatDateTime(item()?['Arrived'], 'dd/MM/yyyy HH:mm'))
  • Sach2022 Profile Picture
    54 on 05 Apr 2022 at 14:04:20
    Re: Format Date Time to dd/mm/yyyy hh:mm

    Ok, I have managed to sort out my CSV fields (in the Create CSV table) to have a custom expression:

     - formatDateTime(item()?['Arrived'],'dd/mm/yyyy hh:mm:ss')
     
    ...which appears to be working.
     
    However, my dates are coming out like this (first column is formatted date/time and second column is raw: 
    30/18/2022 07:18:362022-03-30T07:18:36.307

     

    Help!?

     

    Thanks.

  • Sach2022 Profile Picture
    54 on 05 Apr 2022 at 07:34:47
    Re: Format Date Time to dd/mm/yyyy hh:mm

    Hi there,

    Sorry, how do I use the Compose Action?

    Attached is screenshot of my flow as described earlier.

    Before in Create CSV Table, I had Automatic, which meant the SP just put the fields into the CSV, but now I need to convert some fields from 2022-04-01T10:29:19.14 to 01/04/2022 10:29 and these objects are called: ResultSets Arrived, ResultSets Departed, ResultSets Host Notified.

    I thought I'd be putting a formatting formula in the box highlighted to format the object coming from the SP (Stored Proc)?flow2.PNG 

    Please help!

    Thanks!

    flow.PNG

     

  • Rhiassuring Profile Picture
    8,688 Super User 2025 Season 1 on 05 Apr 2022 at 04:31:28
    Re: Format Date Time to dd/mm/yyyy hh:mm

    Hi there, 


    I think all you need is a Compose action with formatDateTime([Arrived], 'dd/mm/yyyy hh:mm'). 

    If my reading up on Western Europe is right, then that's UTC itself, so it doesn't need to be converted assuming that's UTC that came out. And if it's stored in a different region, we need to know the region of the source - like Pacific, then it would need conversion using Source and Destination.

    Let me know if this makes sense?

    Cheers,

    Rhia

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1

Featured topics

Restore a deleted flow
Loading complete