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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Wrong date saved in Sh...
Power Apps
Unanswered

Wrong date saved in SharePoint via a PowerApps application

(1) ShareShare
ReportReport
Posted on by 6
Hello,
 
I have an PowerApps link to an SharePoint List. My SharePoint list have these columns:
 
Column Type
Title Single line of text
StartDate Date Time
EndDate Date Time
Date Date Time
 
In my powerapps, i have an interface and One button submit. When user select submit button the data is saved in SharePointList.
 
This is the source code of Submit Button.
 
Set(StardDate, DateAdd(Date(2024-10-14), 720, TimeUnit.Minutes))
Set(EndDate, DateAdd(Date(2024-10-14), 1020, TimeUnit.Minutes))
Set(Date,Date(2024-10-14)))
 
Patch(SharePointList, Defaults(SharePointList),
{
    Title:"Test",
    StartDate: StartDate,
    EndDate:EndDate,
    Date:Date
})
 
 
The problem i have now is this.
 
When the data is saved in sharePoint List, this is how the appear (see table bellow and attachment)
Column Value
Title Test
StartDate 2024-10-14 09:00
EndDate 2024-10-14 14:00
Date 2024-10-13 20:00
 
The column Date have a wrong value 2024-10-13 20:00. Note that this appear only for few nomber of user.
All the user have a same time zone on her computer and her office 365 profile.
 
SharePoint Time zone is the same for all the users.
 
What can explain this time difference for the Date field?
 
Please can you help me?
 
Thanks a lot in advance.
 
 
I have the same question (0)
  • WarrenBelz Profile Picture
    153,127 Most Valuable Professional on at
    Firstly Date is a very bad name for a Variable and I believe your issue may be ambiguity. I have tested this code and it works as expected
    With(
       {
          _Start: DateAdd(Date(2024,10,14), 720, TimeUnit.Minutes),
          _End: DateAdd(Date(2024,10,14), 1020, TimeUnit.Minutes),
          _Date: Date(2024,10,14)
       },
       Patch(
          SharePointList,
          Defaults(SharePointList),
          {
             Title: "Test",
             StartDate: _Start,
             EndDate: _End,
             Date: _Date
          }
       )
    )
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • CU03101748-0 Profile Picture
    6 on at
    hello Warrenbelz, Thanks you for your help. I try your code but i have the same problem for many user.
     
    The issue is perssist.
  • Ellis Karim Profile Picture
    11,695 Super User 2025 Season 2 on at
    As far as I understand:
    • SharePoint stores dates in UTC (Coordinated Universal Time) time zone regardless of the user's or site's time zone settings.
       
    • When you view dates dates in SharePoint, they are displayed according to the site's Regional settings.
       
    • When Power Apps retrieves dates from SharePoint it will be in UTC, displayed based on your PCs Time Zone settings.
       
    • Power Automate reads dates from SharePoint as UTC.

    Example:

    Windows PC Time Zone: UTC-08:00 Pacific Time (US & Canada)
    Windows 11 Region Format (for displaying Date Time): English (United Kingdom)

    SharePoint Item has a Created date:    "2024-10-05T08:15:34Z"
    Power Automate reads the Created date: "2024-10-05T08:15:34Z"


    Power Apps Code displays the date and time:
    (1) "Created: " & ThisItem.Created "05/10/2024 01:15" 
    (2) "Created: " & Text(ThisItem.Created, DateTimeFormat.UTC) "2024-10-05T08:15:34.000Z"


    In (1) above, Power Apps automatically converted the UTC timestamp to my local time zone which is UTC-08:00 Pacific Time (US & Canada). In (2) the Text function is used to format the date and time to UTC .
  • lbendlin Profile Picture
    8,479 Super User 2025 Season 2 on at
    Are your users all on UTC-4 ?
  • WarrenBelz Profile Picture
    153,127 Most Valuable Professional on at
    I am in a different time zone to you, so am just getting back to this (Saturday Morning 7am here). You had already confirmed that the SharePoint time zone was the same (it always is), but it appears that the user/s concerned may have their device Regional Settings four hours behind the SharePoint site. If Date is a date-only field (not date/time), you can do this (or set it at the maximum difference)
    With(
       {
          _Start: DateAdd(Date(2024,10,14), 720, TimeUnit.Minutes),
          _End: DateAdd(Date(2024,10,14), 1020, TimeUnit.Minutes),
          _Date: DateAdd(Date(2024,10,14), 4, TimeUnit.Hours)
       },
       Patch(
          SharePointList,
          Defaults(SharePointList),
          {
             Title: "Test",
             StartDate: _Start,
             EndDate: _End,
             Date: _Date
          }
       )
    )
    The other way is to fix the user's settings, but they may be correct for their location.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • CU03101748-0 Profile Picture
    6 on at
    Thanks for your help,
    Ibendlin: Yes the users have UTC-4
    Ekarim: i understand what do you explain. All the users is on the same Time Zone in their computer and their office 365 profile.
     
    The thing i don't understand is why the problem occur only for one date field if it id the time zone the problem? Normaly if it this the time zone the problem all the date fields must be affected?
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard