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

Displaying TimeStamp on Sharepoint List

Hello Guys,

 

I am building a tracker in which I want to display the current timestamp on my powerapps and insert it on my sharepoint. 

I already displayed the time using the 

error.png

 1.PNG

and my column type on my sharepoint list is Date&Time.

Formula.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

And when I clicked the Submit button using SubmitForm(Insert) it creating a new item on my sharepoint list but not on my Submission_Time. 

Can someone help me on how can I display my timestamp on my sharepoint list?

 

Thank you!

22 REPLIES 22

Hello @v-xida-msft ,

 

Thank you it works fine on me

1.PNG

 

 

 

Yet when I looked the my sharepoint list it looks like this.

error.png

 

Still don't know the problem if it is the Powerapps or the Sharepoint itself?

 

Thank you!

Hi @Marlin-A , 

I think this issue that you mentioned is related to Time Zone setting of your SP Site itself.

 

Please make sure the Time zone setting and Locale setting of your SP Site has been set to same value as that in your Local PC.

 

On your side, please go to your SP Site settings - > "Regional Settings" option, then configure the Time zone and Local setting to same value as your local PC:

10.JPG

 

If the solution I provided above is helpful in your scenario, and you have solved your problem, please go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

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

Hello @v-xida-msft ,

 

Is there any way that I could input the time on my powerapps to my sharepoint list without changing the time zone of the SP Site? 

@Marlin-A ,

As mentioned I was offline for a few hours.

Please tag me if you want to continue the thread with my logic.

I will be back in the morning (10pm here)

Hi @Marlin-A ,

There is actually a very easy solution to this which I use for all my timestamps, but involves moving away from SubmitForm to Patch. You simply Patch New() to the date/time field in Sharepoint with the rest of the new record. The syntax is the normal Patch new record

 

Patch(
   SharePointListName
   Defaults(SharePointListName),
   {
      DateTimeFieldName:Now()
      ListField1: Control1Output,
      ListField2: Control2Output,
      ListField3: Control3Output,
      Xxxxxx
      Xxxxxx
   }
)

 

just needs the SharePoint fields on the left and the control output (ControlName.Text, ControlName.Selected.xxxxx) on the right.

My earlier solution with the settings on the three date/time elements should work as well.

 

Please click Accept as solution 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 Thumbs Up.

 

Hello again sir @WarrenBelz ,

 

Yes sir, I do Patch when submitting the form, and the problem that I am having right now is a timezone because I got a correct Date&Time on my gallery when I patch the form. Here is the screenshot.

1.PNG

 

 

 

 

But when I took a look on my Sharepoint List the Date&Time is not the same record as the gallery captured.

Here is the screenshot of my sharepoint list when I took a patch.
error.png

 

Should I really changed the Regional Timezone on my Sharepoint List to get the same result on my gallery? or is there any way that I could get a same result on my gallery without changing the settings on my sharepoint site.

 

Thank you!

 

Hi @Marlin-A ,

Do you use a different timezone to that of your SharePoint site? Sorry for the "light bulb" not coming on sooner.

You can use TimeZoneOffset . The function

TimeZoneOffset(Now())

will get you the minutes difference to UTC time - as an example mine is -600 (10 hours ahead) and you can do some calculations of this based on any user.
If you know how much you are always out, just use DateAdd. So if you need to take off 9 hours in the Patch, you would send back

YourDateFieldName:DateAdd(Now(),-9,Hours)

This should send back a date/time of 9 hours ago to SharePoint and the Regional Settings should put it back to your current time.

 

Please click Accept as solution 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 Thumbs Up.

Hello sir @WarrenBelz ,

 

The Date&Time on my gallery is the correct timezone that I have on my country which is GMT+8. and what I got on my sharepoint list is on GMT-7, so the timezone on my Sharepoint Site is not the same as my timezone in here.

So what I want to see is I want to display my current timezone which is GMT+8 in my Sharepoint List without converting it on GMT-7.

which my Time in here is 14 hours ahead?


Thank you!

Ok @Marlin-A ,

It is only the mathematics needing fixing - I was trying to give you examples.

I am not sure that you mean about not converting it - you are in Western Australia (I assume) and your SharePoint site is set for somewhere in Western US/Canada - so you have 15 hours difference. If you patch (and I just tested this and got 15 hours ahead)

DateAdd(Now(),15,Hours)

your SharePoint server will add that to its time in the Rocky Mountains and patch the current time in West Oz.
As mentioned if you have users elsewhere in the world - again I hope this is right calc, but you will get the idea - Patch

DateAdd(Now(),7-(TimeZoneOffset(Now())/60),Hours)

This will add 7 to the 8 you are in front (double minus) 7 minus (-8) = 15.

Please click Accept as solution 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 Thumbs Up.

 

View solution in original post

Hi @Marlin-A ,

Do you want to save correct date time value into your SP List without changing the Time zone setting within your SP Site?

 

Based on the needs that you mentioned, I think there is no simple solution to achieve your needs. Actually, when working with date time value within PowerApps app, the date time value would be converted into UTC format automatically, then pass the converted UTC time value back to your data source (e.g. SP List).

Within your SP List, the passed UTC format date time value would be displayed with proper time format based on the Time Zone settings you set in your SP Site.

 

As an direct solution, you should change the Time Zone setting in your SP Site, then the date time value would be stored properly, and you do not need to care about the Time Zone issue.

 

If you do no want to change the Time Zone setting in your SP Site, I agree with @WarrenBelz 's thought almost.  I think the DateAdd function and TimeZoneOffset function could achieve your needs. Please check the following article for more details:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-dateadd-datediff

 

You need to know the time zone offset of your SP Site Time Zone setting firstly, then you could use the DateAdd function and TimeZoneOffset function to convert the entered date time value in your app to proper date time value, then pass it into your SP List (I think it is complex).

 

Best regards,

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

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (26,792)