Forum Discussion
PatrickM135
Sep 13, 2024Copper Contributor
Enter Time Into Date/Time Column?
I'm tracking outages of certain systems and need to calculate down to the second, but date/time in SharePoint only allows me to enter Time up to minutes (11:54am for example, instead of 11:54:22am). ...
michalkornet
Sep 15, 2024Iron Contributor
HI PatrickM135, seconds are also stored in the DateTime column, so you can use column formatting to display the time with seconds in the list. Here's an example:->
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=toLocaleDateString(@currentField) + ' ' + toLocaleTimeString(@currentField)"
}
The challenge, however, is how to edit the value. If you can use SPFx Form customization, you can leverage the PnP Control for the DateTime column to include seconds as well: -> https://pnp.github.io/sp-dev-fx-controls-react/controls/DateTimePicker/