cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ZF-AtPride
Level: Powered On

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
Dual Super User
Dual Super User

Re: Issue with formatDateTime(utcNow()

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

Dual Super User
Dual Super User

Re: Issue with formatDateTime(utcNow()

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
Dual Super User
Dual Super User

Re: Issue with formatDateTime(utcNow()

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.
Dual Super User
Dual Super User

Re: Issue with formatDateTime(utcNow()

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

ZF-AtPride
Level: Powered On

Re: Issue with formatDateTime(utcNow()

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.

Dual Super User
Dual Super User

Re: Issue with formatDateTime(utcNow()

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

Super User
Super User

Re: Issue with formatDateTime(utcNow()

@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
ZF-AtPride
Level: Powered On

Re: Issue with formatDateTime(utcNow()

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

 

Email is showing correct date now.

 

Thanks!

Dual Super User
Dual Super User

Re: Issue with formatDateTime(utcNow()

@ZF-AtPride 

 

I have done that plenty of times 🙂

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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
Currently online: 135 members 4,915 guests
Please welcome our newest community members: