I'm new to JSON Formatter and I need to format a list in gallery view. I have a date and time field, and I am using the expression "=toLocaleTimeString([$Date])", but the time is being displayed like this 15:05:00 PM, I would like it to display only 15:05 PM without the seconds

2 Answers 2


I am not sure if there is such an option in JSON Formatter. Alternatively, you can create a Calculated Column for such a purpose instead. In your gallery view, display this Calculated Column instead of the original Date/Time column.

Formula to use: =TEXT(Date,"h:mm am/pm")

This is the 'Calculated Column' details: enter image description here

How the gallery view will look like: enter image description here


Try to use the following code:

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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.