cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Issue with formatDateTime(utcNow()

I have a flow that includes a date stamp in an email. It is returning odd data when the flow is triggered.

 

I have tried the following uctNow formulas

 

formatDateTime(utcNow(), 'mm/DD/yyyy')

formatDateTime(utcNow(),'mm/DD/yyyy')   *Note that there is no space between the comma and apostrophe

utcNow('mm/DD/yyyy')

 

Regardless of the formula I use, I get a date like this:

 

34/DD/2019

 

While the year is showing correctly, the day always appears as DD, and i have discovered that the month always shows the minute of the hour that I submitted the form (I submitted this example at 8:34am).

 

Thoughts?

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Sorry, forgot the month's are also the wrong case.  Make it 'MM/dd/yyyy'.  Check this Blog

 

https://veenstra.me.uk/2018/11/12/microsoft-flow-format-dates/



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

View solution in original post

Highlighted

hI @ZF-AtPride 

 

Retry with 

formatDateTime(utcNow(), 'MM/dd/yyyy')
your expression probably was not updated
 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

7 REPLIES 7
Highlighted
Dual Super User III
Dual Super User III

Its not recognizing the capital D's as the day format.  Try 'mm/dd/yyyy' for your format string.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Dual Super User III
Dual Super User III

Sorry, forgot the month's are also the wrong case.  Make it 'MM/dd/yyyy'.  Check this Blog

 

https://veenstra.me.uk/2018/11/12/microsoft-flow-format-dates/



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

View solution in original post

Highlighted

Thanks for the quick reply.

 

I tried 'MM/dd/yyyy' as you suggested. It returned 45/09/2019

 

Expected result should have been 09/09/2019. So it looks like using dd in place of DD worked as it is showing the correct day, but it's still showing the minute of the hour that I triggered the flow.

Highlighted

hI @ZF-AtPride 

 

Retry with 

formatDateTime(utcNow(), 'MM/dd/yyyy')
your expression probably was not updated
 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

Highlighted

@ZF-AtPride 

Please see my screen shots below:

DateTime1.jpg

DateTime2.jpg

 

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

Scott
Highlighted

Good catch...I saved the Flow but forgot to update the formula. Rookie move...

 

Email is showing correct date now.

 

Thanks!

Highlighted

@ZF-AtPride 

 

I have done that plenty of times 🙂

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Users online (2,913)