cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dave8
Impactful Individual
Impactful Individual

How to update current date and time with "date and time" list column in SharePoint?

Hello,

 

I have a Date and Time field in SharePoint list that displays date and time both.

 

I want to patch, current date and time in that field, and I have tried followings in Patch function:

 

Today()+Text(Now(), "[$-en-US]hh")+Text(Now(), "[$-en-US]mm")

 

However, this is not working out, Would you please share how can I patch current date and time with "date and time" list column in SharePoint?

 

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @dave8 ,

Could you please share a bit more about your your Patch formula used within your canvas app?

 

If you want to create a new record in your SP List, please try the following formula:

Patch(
      'Your SP List',
      Defaults('Your SP List'),
      {
        Title: "xxx",
        DateTimeField: Now()
      }
)

If you want to update existing record in your SP List, please try the following formula:

Patch(
      'Your SP List',
      LookUp('Your SP List', PrimaryColumn = "Specific value"), // find the record you want to update
      {
        DateTimeField: Now()
      }
)

Note: Please assign Now() function result to the DateTimeField directly within your Patch function.

 

In addition, you could also consider use the following formula to get the current date time value for the DateTimeField in your SP List:

Today() + Time(Hour(Now()), Minute(Now()),Second(Now()))

 

When saving date time value from your canvas app back to your SP List, you may face time zone issue -- the date time value within your canvas app is not same as that saved in your SP List. Please make sure the Time Zone settings of your SP Site is set to your local time zone.

6.JPG

 

 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.

View solution in original post

4 REPLIES 4
dave8
Impactful Individual
Impactful Individual

Looks like this should be working - 

DateAdd(Now(),0,Minutes)

However, my Patch function is not working, therefore I could not realize the root cause.

 

Thanks, 

GarethPrisk
Resident Rockstar
Resident Rockstar

There is also a Today function within PowerApps, FYI.

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-now-today-istoday

 

There is also an Errors function, to allow you to dig deeper into why you Patch is failing.

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

Kindly show the Patch formula you are using

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

v-xida-msft
Community Support
Community Support

Hi @dave8 ,

Could you please share a bit more about your your Patch formula used within your canvas app?

 

If you want to create a new record in your SP List, please try the following formula:

Patch(
      'Your SP List',
      Defaults('Your SP List'),
      {
        Title: "xxx",
        DateTimeField: Now()
      }
)

If you want to update existing record in your SP List, please try the following formula:

Patch(
      'Your SP List',
      LookUp('Your SP List', PrimaryColumn = "Specific value"), // find the record you want to update
      {
        DateTimeField: Now()
      }
)

Note: Please assign Now() function result to the DateTimeField directly within your Patch function.

 

In addition, you could also consider use the following formula to get the current date time value for the DateTimeField in your SP List:

Today() + Time(Hour(Now()), Minute(Now()),Second(Now()))

 

When saving date time value from your canvas app back to your SP List, you may face time zone issue -- the date time value within your canvas app is not same as that saved in your SP List. Please make sure the Time Zone settings of your SP Site is set to your local time zone.

6.JPG

 

 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.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,077)