Sharepoint list with contacts column "Time" json formating

Anonymous
2022-03-28T20:08:31.36+00:00

In a Contact list, the "Date and Time" column format to show the respective time zone of a contact entry.

my current state is this:

..

"txtContent": "=toLocaleTimeString(@now )"

but I want the local time of the entered person to be displayed.

How can i do this with json formating?

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Echo Du_MSFT 17,316 Reputation points
    2022-03-29T03:03:41.343+00:00

    Hello @saranda-8772 ,

    Welcome to Q&A Forum!

    According to your description, you can directly use the [Created] column that comes with SharePoint. [Created] is used to store and display the current time when the item was created.

    Please follow the steps:

    1.Go to the Contact list as a site admin

    2.Click Add column + >> Show/hide columns

    187620-1.jpg

    3.On the Edit view columns windows, select [Created] column and click Apply

    187733-2.jpg

    4.Click [Created] >> Column settings >> Format this column

    187700-3.jpg

    5.On the Format Created column panel, click "Advanced mode"

    187751-4.jpg

    6.Use the below JSON code:

    {  
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",  
      "elmType": "div",  
      "txtContent": {  
        "operator": "toLocaleString()",  
        "operands": [  
          "@currentField"  
        ]  
      }  
    }  
    

    187690-5.jpg

    Thanks,
    Echo Du

    ===========================================

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.