cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Kamel
Level: Powered On

Formatting Date And time in MS Flow

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

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Formatting Date And time in MS Flow

@Kamel- give this a try:

 

I used this format ina an expression:

formatDateTime(utcNow(),'MM/dd hh:mm tt')
 
Which produced a date/time string that looks like this:
07/20 08:08 PM
 
DateFormat.jpg
 
If this works for you, please mark you Post as Solved.
 
Scott

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

jaylou
Level 8

Re: Formatting Date And time in MS Flow

HI Kamel,

If you are still having an issue with formatting the date, have you tried to use "Convert Timezone"?  I convert all dates before I send them in an alert.  There are many formating options for you to choose.

 

ConvertTimeAction.jpg

 

Hope this helps,

Joe

View solution in original post

15 REPLIES 15
Super User
Super User

Re: Formatting Date And time in MS Flow

@Kamel- give this a try:

 

I used this format ina an expression:

formatDateTime(utcNow(),'MM/dd hh:mm tt')
 
Which produced a date/time string that looks like this:
07/20 08:08 PM
 
DateFormat.jpg
 
If this works for you, please mark you Post as Solved.
 
Scott

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Kamel
Level: Powered On

Re: Formatting Date And time in MS Flow

Worked like a charm! Thank you so much!

Kamel
Level: Powered On

Re: Formatting Date And time in MS Flow

It worked once and then quit and went back to sending the way it was 😞

jaylou
Level 8

Re: Formatting Date And time in MS Flow

HI Kamel,

If you are still having an issue with formatting the date, have you tried to use "Convert Timezone"?  I convert all dates before I send them in an alert.  There are many formating options for you to choose.

 

ConvertTimeAction.jpg

 

Hope this helps,

Joe

View solution in original post

magalygreyes
Level: Powered On

Formatting Date And time in MS Flow

Greetings

 

I tried this :

formatDateTime(utcNow(), 'MM/dd hh:mm:tt')

 

To update dates and times for Form submited for approval , however it shows todays's date and I am trying to show the dates from the form submitted , how can I format this dates so it shows the right format when email is received for approval ?

Approval email example vs form submitted

 

 

Boneckrh19
Level 8

Re: Formatting Date And time in MS Flow

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

fatimat
Level: Powered On

Re: Formatting Date And time in MS Flow

I'm building a flow that would notify certain users when dates are changed. I did the following:
1. I created 2 hidden fields: Old Start date and Old End date (Date and Time fields in Sharepoint Events List).
2. In my flow, I convert all four fields (Old and New Start dates and End Dates) from UTC to NZST with format mm/d/yyyy h:mm AM/PM.
3. I check:
   A. New and Old Start dates are equal, and
   B. New and Old End Dates are equal
If false, Sharepoint sends an email to users that these dates have been changed.
4. The item is updated to populate the Old Start and End dates with the values from the New Start and End dates.

 

My problem is whether I use the New or the converted values to update the Old value fields, the values returned to Sharepoint turn out differently from the unconverted values.

Is there any way to fix this?

magalygreyes
Level: Powered On

Re: Formatting Date And time in MS Flow

convert time zone .jpg

 

This is how I fixed time zone in my flow .

1. Started my flow  with the action, in this case is when an item is created in sharepoint list ,

2. I added Convert time zone action after one for the start date and another for the End time

Here is how it looks

 

 

fatimat
Level: Powered On

Re: Formatting Date And time in MS Flow

Thanks, but strangely, it's working now. 

 

I removed all the conversions and just used the fields themselves. I think there's just a delay in displaying the changes to the Old and New Start dates in Sharepoint. And I think the only mistake I had in the first place was having "Date and Time" format for the New dates, and the "Date only" format for the Old Dates. After aligning those formats, I started adding the conversions and other stuff in it and the delay didn't help either. 

ProNewbie
Level: Powered On

Re: Formatting Date And time in MS Flow

I'm using the Convert Time Zone action but it does translate the days names from my language to english automatically.........

jeraldaustero
Level: Power Up

Re: Formatting Date And time in MS Flow

How to get week number?

CarlHRVA
Level 8

Re: Formatting Date And time in MS Flow

This is the trick!

Vinod_babu
Level: Power Up

Re: Formatting Date And time in MS Flow

Hi, 

I have also used the same format time and as per my requirement I need output as day like "Monday" or "Tuesday" to set a delay .

I've tried the format date and time i'm able to retrieve date like 24,12 etc., but unable to get name of day.

Can you please suggest me a method to get It.

 

Thanks

Super User
Super User

Re: Formatting Date And time in MS Flow

@Vinod_babu 

To get the full day of week, use the 'dddd' date format string.  See my example below.

DayOfWeek1.pngDayOfWeek2.png

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
mel_hudson
Level: Powered On

Re: Formatting Date And time in MS Flow

Sorry everyone newbie here. Im struggling to get the right expression to work in a Create Event (4), to format a date.

 

I can get the date in the event from my Online Excel Sheet, by using the below expression but I can seem to find the right way to format it?? Would like it to appear in the body of the event as 'AUS Eastern Standard Time','dd/MM/yyyy HH:mm'

  • addDays('1900-01-01T00:00:00Z',sub(int(item()?['Task Allocation Date']),2))

Ive been able to use the below when adding a row to a table and it works but I cant seem to find the right string to use in an event??

  • convertTimeZone(Body('create_event_(v4)')?['CreatedDateTime'],'UTC','AUS Eastern Standard Time','dd/MM/yyyy HH:mm')

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users online (5,775)