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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Format Date Time to dd...
Power Automate
Unanswered

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,690 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard