cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dFranco1
Level: Power Up

Vacation Approval Flow Saving Data Incorrectly (offset by one day)

Hi All,

I have a flow that is working well where users can request vacation from their manager. The date gets stored correctly by Flow but at the final step when the vacation is approved and it gets saved into a SP Calendar, the dates are always off by one day. For example:

 

A date like 2019-06-06T00:00:00.0000000

Gets saved to the calendar as 2019-06-05 6:00 PM

 

I suspect the issue is with how the SP Calendar consumes my date? Does anyone know a fix?

1 ACCEPTED SOLUTION

Accepted Solutions
v-zhos-msft
Level 10

Re: Vacation Approval Flow Saving Data Incorrectly (offset by one day)

Hi @dFranco1 ,

It's a time zone issue.

You can use the convertFromUtc() function to convert the time to your time zone.

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#c...

I have made a test on my side, please take a try with the following workaround:

I use the 'Created' and 'Modified' as the 'Start time' and 'End time'.

The expression is: 

convertFromUtc(body('Get_item')?['Modified'],'China Standard Time','yyyy-MM-ddTHH:mm:ssZ')

Capture7.PNG

Best Regards,

Community Support Team _ Zhongys

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

2 REPLIES 2
Super User
Super User

Re: Vacation Approval Flow Saving Data Incorrectly (offset by one day)

HI @dFranco1 

 

I am guessing thos could be a time zone issue. Flow performs all operations on the UTC time zone. If you colud share a screenshot of the flow, we maybe able to assist you better,

 

Thanks, 

v-zhos-msft
Level 10

Re: Vacation Approval Flow Saving Data Incorrectly (offset by one day)

Hi @dFranco1 ,

It's a time zone issue.

You can use the convertFromUtc() function to convert the time to your time zone.

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#c...

I have made a test on my side, please take a try with the following workaround:

I use the 'Created' and 'Modified' as the 'Start time' and 'End time'.

The expression is: 

convertFromUtc(body('Get_item')?['Modified'],'China Standard Time','yyyy-MM-ddTHH:mm:ssZ')

Capture7.PNG

Best Regards,

Community Support Team _ Zhongys

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

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: 83 members 3,333 guests
Please welcome our newest community members: