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 / Powerapps datetime to ...
Power Apps
Answered

Powerapps datetime to Sharepoint: Always storing the time as 00:00

(0) ShareShare
ReportReport
Posted on by 19

When I patch now() to sharepoint it stores the date correctly but the time is always midnight (00:00).

 

 

 

 

Patch(SharepointList, LookUp(SharepointList, CustomerID = varCustomer.ID),{
 Raised_DateTime: Now()
})

 

 

 

Which works but shows up in Sharepoint as "30/01/2021 00:00", when it should show "30/01/2021 15:42".

 

I have tried workarounds for this such as converting the date to text and then patching a DateTimeValue() of it...

e.g.

 

 

 

Patch(SharepointList, LookUp(SharepointList, CustomerID = varCustomer.ID),{
 Raised_DateTime: DateTimeValue(Text(Now()))
})

 

 

 

This also does the same thing.

When I set up a label in powerapps to show me the value of Now() it gives me the full datetime.

 

I have googled this to exhaustion.

Does anyone know how to get sharepoint to also store the time correctly?

 

FYI I am in the UK. I have checked the sharepoint site Regional Settings. They are set to:

Time zone = (UTC) London

Region = English (United Kingdom)

Time Format = 24hour

EDIT: Forgot to mention that the column in question is set to Type = Date and Time and the 'Include Time' switch is set to Yes.

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,739 Most Valuable Professional on at

    The first thing to check is to make sure the SharePoint column settings aren't set for Date Only.  The column will always store a full date and time, but if the column is set to Date only the time will always be midnight UTC.  Otherwise I just tested the following on one of my columns set for Date & Time and it stores both date and time.

    Patch(Test_1,LookUp(Test_1,ID=1),{StartTime:Now()})

     

  • ncr703 Profile Picture
    19 on at

    Hi Pstork, thanks for responding. I do have a feeling this is something in sharepoint.

    I have checked the settings - please see picture below. Do you know if there any other settings other than those referenced in my original post?

    Many thanks.

    datetime.PNG

  • Pstork1 Profile Picture
    68,739 Most Valuable Professional on at

    I'm not aware of any other settings.  But I am curious what kind of list this is? AS you can see from the screenshot below I get a different view when editing the column than you do.  I don't recognize the dialog that you are looking at.

    image.png

  • ncr703 Profile Picture
    19 on at

    The menu I screenshotted comes from clicking the column title and selecting Column Settings -> Edit.

    I can reach the same screen as your screenshot by going through Settings (top right corner) -> List Settings and then selecting my Raised_DateTime from 'Columns'.

     

    I suspect I'm using the 'new' sharepoint GUI rather than the 'classic' one. I am a new sharepoint user with no experience.

     

    Anyway - I have checked my settings. They are identical to yours. I have also copied your code and it still shows the time as 00:00.

    Copied code (in OnSelect on a new button):

    Patch(TMS_Test_Request_Main, LookUp(TMS_Test_Request_Main, ID=1),{Raised_DateTime:Now()})



  • Pstork1 Profile Picture
    68,739 Most Valuable Professional on at

    Got it. I didn't remember the ability to edit the individual columns from the list.  I've been at it a long time and just have always gotten used to going through the list settings to edit the columns. But mine is also a "Modern" list.  So no differences there.  I don't have anything else to suggest other than checking to validation or column formatting settings to see if some javascript is being applied during the save.  As I said it works for me on a regular DateTime column in a modern list.  From what I see it should work in yours too.

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    @ncr703 I echo the thoughts of @Pstork1  here in that it 'should' be working as you expect.

     

    Have you tried creating a new column with the correct settings and patching to that new one? Also, was this column originally a 'Date only' column which has been changed? This can sometimes cause issues in SharePoint.

  • Pstork1 Profile Picture
    68,739 Most Valuable Professional on at

    One other thought.  If it was changed from Date Only to Date and Time, but the data source wasn't refreshed that could be an issue also.

  • ncr703 Profile Picture
    19 on at

    @Anonymous wrote:

    @ncr703 I echo the thoughts of @Pstork1  here in that it 'should' be working as you expect.

     

    Have you tried creating a new column with the correct settings and patching to that new one? Also, was this column originally a 'Date only' column which has been changed? This can sometimes cause issues in SharePoint.


    That was it! I deleted the column and re-made it, and its now working fine.

    You are correct - When I created that column several days ago I failed to tick the 'Include Time' column. Apparently switching it on later can cause this issue.

    Thanks to both of your Eelman and Pstork for getting to the bottom of this.

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