cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dmistry
Level 8

Flow email shows wrong time for datetime sharepoint fields

Hi,

 

I have two sharepoint datetime fields part of a sharepoint list as : From and To, see screenshot below.

SP.JPG

 

 

See flow screenshot below:

Capture.JPG

Formulas I am using for both fields in Select action are as below:

 

From: 

formatDateTime(item()?['From'],'MM-dd-yyyy hh:mm tt')
 
To: 
formatDateTime(item()?['To'],'MM-dd-yyyy hh:mm tt')
 
Below is what I am getting as output in flow email body:
Capture.JPG
when comparing it with the sharepoint values, dates are correct but time is completely off. Can someone please help me correct this, should be an easy fix. Thanks in advance.
1 ACCEPTED SOLUTION

Accepted Solutions
dmistry
Level 8

Re: Flow email shows wrong time for datetime sharepoint fields

Thanks @Brad_Groux  but unfortunately that does not help.

I revised my formula as below in the select action for From data card as and it worked like a charm:

 

formatDateTime(convertTimeZone(item()?['From'],'Eastern Standard Time','Eastern Standard Time'),'MM-dd-yyyy hh:mm tt')
4 REPLIES 4
Highlighted
Super User
Super User

Re: Flow email shows wrong time for datetime sharepoint fields

HTML date/time formatting also requires manipulation, which is generally handled within the HTML or CSS of the page. You'll need to add/update the required code to your table either during, or after the initial output.

If you view your current HTML output, you should be able to see how the HTML time is being formatted, and then you'd simply replace that <time> tag to match the formatting within your SharePoint List, example: 

<time datetime="MM-dd-yyyyhh:mm:ssTZD">

Note that the TZD would need to be replaced with your time zone designator, example EST, CST, PST, etc. 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

dmistry
Level 8

Re: Flow email shows wrong time for datetime sharepoint fields

@Brad_Groux  thanks. I checked the flow run and it seems that get items itself is grabbing time wrong than what's there in sharepoint. So basically I don't see an issue with other actions, any thoughts why Get items would grab wrong time stamp?

Super User
Super User

Re: Flow email shows wrong time for datetime sharepoint fields


@dmistry wrote:

@Brad_Groux  thanks. I checked the flow run and it seems that get items itself is grabbing time wrong than what's there in sharepoint. So basically I don't see an issue with other actions, any thoughts why Get items would grab wrong time stamp?


Just add a format date/time compose step after the get items step to obtain your desired date/time format, example:

formatDateTime(utcNow(),'yyyy-MM-ddT00:00:00Z')

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

dmistry
Level 8

Re: Flow email shows wrong time for datetime sharepoint fields

Thanks @Brad_Groux  but unfortunately that does not help.

I revised my formula as below in the select action for From data card as and it worked like a charm:

 

formatDateTime(convertTimeZone(item()?['From'],'Eastern Standard Time','Eastern Standard Time'),'MM-dd-yyyy hh:mm tt')

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow 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 Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 516 members 5,223 guests
Please welcome our newest community members: