cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jltitus
Helper III
Helper III

Correct the date/time in the body of the email to align to the .ics file

I'm working on a flow where when the event item is created an email is sent with an .ics file and information.

I'm using the following expressions to put the start/end times in a format that works for the invite:

  • Start 

 

formatDateTime(triggerBody()?['StartDate'],'dddd, MMMM dd, yyyy h:mm tt')​

 

  • End

 

formatDateTime(triggerBody()?['EndDate'],'dddd, MMMM dd, yyyy h:mm tt')​

 

2022-04-26_13-37-35.jpg

ISSUE: While the .ics file has the correct time in it, the body text of the email does not. I've also tried replacing with the composed formatStartTime and formatEndTime without success.

2022-04-26_13-40-58.jpg

 

ASK: How to I correct the date/time in the body of the email to align to the .ics file?

 

2022-04-26_13-42-20.jpg

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @Jltitus ,

 

This is a problem caused by the time difference. The time displayed in the SharePoint Site and Outlook are both local time. But Flow converts the time to UTC when performing time calculations.

So the easiest way is to add a date offset to the time.

formatDateTime(addHours(triggerBody()?['StartDate'],-7),'dddd, MMMM dd, yyyy h:mm tt')

 

Best Regards,

Bof

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @Jltitus ,

 

This is a problem caused by the time difference. The time displayed in the SharePoint Site and Outlook are both local time. But Flow converts the time to UTC when performing time calculations.

So the easiest way is to add a date offset to the time.

formatDateTime(addHours(triggerBody()?['StartDate'],-7),'dddd, MMMM dd, yyyy h:mm tt')

 

Best Regards,

Bof

That did it, thanks so much @v-bofeng-msft 

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,745)