Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Patch date and time with timezone difference

(0) ShareShare
ReportReport
Posted on by 7

Hello there, I hope you can help me out here, because i'm completely lost. I have an app in powerapps where i patch a datetime picker to a date time column in sharepoint. It patches ok but there is a 4 hours difference between the hour i submitted in the app and the hour that was patched in the sharepoint. Same thing happens with the submission:Now() part of the code. What am I doing wrong?
If you need it , the code for the OnSelect property of the submit button is this: 

Patch(
    'TestList2',
    Gallery3.Selected,
    {
        Status: {Value: "Pending"},
           'Timestamp':DateValue2_1.Value +
                         Time(Value(HourValue2_1.Selected.Value), Value(MinuteValue2_1.Selected.Value),0),
        Submission:Now()
        }
 
Thanks in advance!
Categories:
  • Maurizio1 Profile Picture
    7 on at
    Re: Patch date and time with timezone difference

    You rock!! Thanks so much, it worked perfectly!

  • Verified answer
    v-bofeng-msft Profile Picture
    on at
    Re: Patch date and time with timezone difference

    Hi @Maurizio1 ,

     

    Firstly, let me explain why you encountered this problem.

    The point is timezone. The time in your App is the local time. When the time is saved to SharePoint, it will be converted according to the time zone set by your SharePoint Site. So the time you get is different from the time in the App.

    Secondly, I have two solutions :

    Solution1:Modify the formula

    Submission:DateAdd(Now(),X,Hours),

    Solution2:Change the TimeZone of your SharePoint Site

    Site contents>Site Settings>Site Administration>Regional settings

    vbofengmsft_0-1715215538758.jpeg

     

    vbofengmsft_1-1715215538759.jpeg

     

    Best Regards,

    Bof

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard