Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
31.6k views
in SharePoint Online by 1 1 2

I have SharePoint List in a modern experience SharePoint online site and I want to use JSON column formating to display the date in dd/mm/yyyy format without time in SharePoint List.

json code to display date in dd-mm-yyyy format without time in sharepoint

I've tried using toLocaleDateString() and toDateString() to show date as dd/mm/yyyy but still do nothing

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

Is it possible to format the date column in dd-MM-yyyy using JSON column formatting?


1 Answer

1 like 0 dislike
by 160 200 389
selected by
 
Best answer

How to display Date column format in dd-MM-yyyy using JSON column formatting?

To display the SharePoint date format as dd/MM/yyyy, you should use the SharePoint calculated column instead of using JSON column formatting as the following:

Steps:

  1. Open your SharePoint List > At all items > click on Add new column > More.
    add new calculated column in sharepoint modern list
  2. Create a new calculated column with the below formula to format date with

     =TEXT(Start,"dd/MM/yyyy")
    
  3. The final calculated column setting should look like the below image.
    format date in calculated column sharepoint
    4.Click OK, then go back to your List, you should note that the Date column format is now displaying in dd-MM-yyyy as below.
    json code to display date in dd-mm-yyyy format without time in sharepoint

Note: You can now apply your JSON code formatting on the newly created SharePoint Calculated Column as you prefer.


See Also

If you don’t ask, the answer is always NO!
...