web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Time showing up differ...
Power Apps
Answered

Time showing up different in teams and SharePoint list

(1) ShareShare
ReportReport
Posted on by 13

I am making an app that sends an approval request on teams, and then creates an item on SharePoint. I run this flow when I press a button:

MyFlow.Run(User().FullName, Text(inpStart.SelectedDate, "mm/dd/yyyy") & " " & inpStartHr.SelectedText.Value & ":" & inpStartMin.SelectedText.Value & " " & inpStartHalf.SelectedText.Value, Text(inpEnd.SelectedDate, "mm/dd/yyyy") & " " & inpEndHr.SelectedText.Value & ":" & inpEndMin.SelectedText.Value & " " & inpEndHalf.SelectedText.Value, inpReason.SelectedText.Value); Navigate(Confirmation)

 

I know it is a lot of text so I will break down the inputs. First is the name of the user, then a start time, then an end time, then just a result from a choice field. The times are made by appending the hour, minute, and AM/PM to a date (in text format). When I put these times in the teams approval request description using my flow, they show up exactly as expected from the text boxes. However, when the flow puts it in the SharePoint list using the exact same input, date/time is 7 hours behind what was picked. 

 

I sent the request and viewed the SharePoint from the same device so I am in the same time zone (EDT). Why is the time different on SharePoint and how do I fix it? Thanks. 

Categories:
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    The discrepancy is likely because SharePoint stores dates and times in UTC format, while your app and Teams are using your local time (EDT).

     

    You can adjust this by modifying the date and time to account for the time zone difference before sending it to SharePoint. Here's what you can do:

    1. Convert the Local Time to UTC Time: You can use the TimeZoneOffset function to find the difference between local time and UTC time and adjust accordingly.

    2. Modify the Button OnSelect Formula: Here's a modified version of the formula example you provided that should take into account the time zone offset:

    ClearCollect(colStartTime, DateAdd(inpStart.SelectedDate, Value(inpStartHr.SelectedText.Value) + If(inpStartHalf.SelectedText.Value = "PM", 12, 0), Hours) + Value(inpStartMin.SelectedText.Value), Minutes));
    ClearCollect(colEndTime, DateAdd(inpEnd.SelectedDate, Value(inpEndHr.SelectedText.Value) + If(inpEndHalf.SelectedText.Value = "PM", 12, 0), Hours) + Value(inpEndMin.SelectedText.Value), Minutes));
    
    Set(gloStartTimeUTC, DateAdd(colStartTime, TimeZoneOffset(colStartTime), Minutes));
    Set(gloEndTimeUTC, DateAdd(colEndTime, TimeZoneOffset(colEndTime), Minutes));
    
    MyFlow.Run(
     User().FullName,
     Text(gloStartTimeUTC, "mm/dd/yyyy") & " " & Hour(gloStartTimeUTC) & ":" & Minute(gloStartTimeUTC) & " " & If(Hour(gloStartTimeUTC) > 12, "PM", "AM"),
     Text(gloEndTimeUTC, "mm/dd/yyyy") & " " & Hour(gloEndTimeUTC) & ":" & Minute(gloEndTimeUTC) & " " & If(Hour(gloEndTimeUTC) > 12, "PM", "AM"),
     inpReason.SelectedText.Value
    );
    Navigate(Confirmation, ScreenTransition.None);
    

     

    This modification should ensure that the date and time sent to SharePoint will be consistent with the local time zone.

     

    If the flow has further transformations on the time, you might need to align them with this approach.

    See if it helps @Rymazon 

  • Rymazon Profile Picture
    13 on at

    Thanks for the detailed response. However, my TimeZoneOffset() is returning 240 mins or 4 hours but the difference in the SharePoint is 7 hours. I feel like something else must be at play. 

  • Verified answer
    Rymazon Profile Picture
    13 on at

    I think I have found the issue. The reply above is part of it. It treated the time in SharePoint as UTC so I had to convert the time to UTC using TimeZoneOffset and DateAdd (thanks @poweractivate ). However while the date was uploaded to the SharePoint in UTC, it was set to display as PST. Therefore the time difference was 4 hours (EST to UTC) + 3 hours (UTC to PST) = 7 hours. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 194 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 150

Last 30 days Overall leaderboard