SOLVED

Update date field to todays date in a list

Copper Contributor

I have a date field in my list. I need to update it to today's date if anything in the row changed. Can someone show me how to do this.

 

Thanks

5 Replies
You could just use the Modified column.
thanks, How do I reformat it to mm/dd/yyyy

@u156531 go to Site Contents, then select Site Settings and in the settings page that appears select Regional Settings over on the left and change the time zone and locale settings.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP UK (and classic 1967 Morris Traveller driver)

@u156531 

 

As suggested, you can use the SharePoint default Modified column.

 

You can set the date format using 2 ways: Using SharePoint default settings and JSON formatting.

 

SharePoint default settings:

  1. Go to your SharePoint list
  2. Click on Settings (gear) icon at the top right corner and select List settings
  3. Scroll down to Columns section on list settings page and click on Modified column
  4. Set display format to Standard and click OK to save the column settings changes: ganeshsanap_0-1699624834031.png

Output

ganeshsanap_1-1699624885087.png


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

best response confirmed by u156531 (Copper Contributor)
Solution

@u156531 

 

JSON Formatting way:

 

You can use either of below SharePoint JSON column formatting for your modified column: 

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "@currentField"
}

 

OR 

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "=toLocaleDateString(@currentField)"
}

 

Note: When using toLocaleDateString() operator, results vary based on user's locale.

 

You can find the steps to apply JSON column formatting at: Use column formatting to customize SharePoint 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

1 best response

Accepted Solutions
best response confirmed by u156531 (Copper Contributor)
Solution

@u156531 

 

JSON Formatting way:

 

You can use either of below SharePoint JSON column formatting for your modified column: 

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "@currentField"
}

 

OR 

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "=toLocaleDateString(@currentField)"
}

 

Note: When using toLocaleDateString() operator, results vary based on user's locale.

 

You can find the steps to apply JSON column formatting at: Use column formatting to customize SharePoint 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

View solution in original post