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

Working with datetime - different time in SharePoint and Planner

My solution takes SharePoint Task list item and creates / updates Planner task item using this flow action:

timezone_flowAction.png

 

As you can see, I take SharePoint list item date value as read by Power Automate in previous step and simply write it to Due Date Time field of Planner task item, with no formatting or any data operation on it.

 

Now, having this SharePoint task list item dated 30.04.2020 ...

timezone_sharepoint-ui.png

 

… results into this Planner task

 

 

planner-ui.png

… and if we export both records to excel and compare datetimevalue, I get 7:07 or 6:06 difference, which leads me to some time-zone problem.

timezone_difference.png

I have found that both, SharePoint and PowerApps are set to same timezone, can not find any setting or post how to handle it within a flow.

Many thanks for any advice or link to solved solution which I did not find.

 

David

1 ACCEPTED SOLUTION

Accepted Solutions

Resolved. My previous plan did not work as Flow reads SharePoint's datetime local value already in UTC (e.g. Due Date in SharePoint 2020-07-17 is read as 2020-07-18 by flow.

 

Therefore I read timezone info using HTTP request to SharePoint, take Bias value, convert it to hours and using addHours expression as recommended by @v-litu-msft and @ChristianAbata.

 

It works:

timezone_resolved.png

View solution in original post

5 REPLIES 5
ChristianAbata
Super User
Super User

hi @DavidDostal  the principal reason is the time, see a new day starts in planner at 00:00:01 so what you need to do is add a time inside your day for example 04-30-2020T07:01:00Z



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Thanks @ChristianAbata,

yes, probably time issue. The source datetime value in SharePoint contains time information (30.4.2020 17:00) the resulting Planner Representation of that is NEXT day with no time info. I am not sure if I understand you,  what time should I add to what time. Might be I am not getting something, but the formula should look like PlannerDateStamp = SharePointDateTimeStamp - X:XX, if the solution is about time manipulation as Planner value is currently higher than SharePoint value?

Hi @DavidDostal,

 

I guess you're in the UTC+7 time zone, right?

If so, it is caused by the when create the Planner task, the Due Date Time is considered as a UTC time:

Annotation 2020-04-23 103938.png

For time adjust, the timestamp will add 7 hours base on (30.4.2020 17:00).

As a workaround, you could use the addHours() function to sub the Finish date 7 hours.

addHours('TimeStamp',-7)

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Many thanks, @v-litu-msft.

 

as seen here, there are two difference values 07:07 and 06:06 (hours:minutes)timezone_differences_2.png

 

Which motivates me to put together more general solution than adding some specific datetime value (my solution might be used in various timezones). I am going to try following solution:

1. Get SP-DateTimeOriginal value (in local timezone)

2. Set variable SP-DateTimeConverted (to Planner UTC)

3. calculate difference between SP-DateTimeOriginal and SP-DateTimeConverted

4. Write PL-DueDateTime = addHours(SP-DateTimeOriginal, result of 3)

 

I will let the community know.

Resolved. My previous plan did not work as Flow reads SharePoint's datetime local value already in UTC (e.g. Due Date in SharePoint 2020-07-17 is read as 2020-07-18 by flow.

 

Therefore I read timezone info using HTTP request to SharePoint, take Bias value, convert it to hours and using addHours expression as recommended by @v-litu-msft and @ChristianAbata.

 

It works:

timezone_resolved.png

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,144)