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 / Format Date Time to dd...
Power Automate
Answered

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

(0) ShareShare
ReportReport
Posted on by 56

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!
Categories:
I have the same question (0)
  • Rhiassuring Profile Picture
    8,692 Moderator on at

    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

  • Sach2022 Profile Picture
    56 on at

    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

     

  • Sach2022 Profile Picture
    56 on at

    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.

  • Verified answer
    Sach2022 Profile Picture
    56 on at

    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'))

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard